|
|
 |
| Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Visual Basic 2008 Essentials section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 3rd, 2009, 12:00 PM
|
|
Authorized User
|
|
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
TextBox to ListBox show
Code:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
'MessageBox.Show(txtPerson.Text.ToString)
'this messagebox works when I run it
'please can you help me to show text in listbox?
lstDisplay.Show.txtPerson.Text.ToString()
'the error Expression does not produce a value
End Sub
End Class
|

September 3rd, 2009, 01:28 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
|
|
Clarify please...
can you be a little more clear as to what you are trying to do? are you trying to add the text of a text box to a listview? or highlight a listview item based on text in a textbox?
__________________
Jason Hall
|

September 3rd, 2009, 01:35 PM
|
|
Authorized User
|
|
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Listbox
I am trying to show the value in textbox in listbox
|

September 3rd, 2009, 01:39 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
|
|
How about this..
How about something like this?
ListView1.Items.Add(TextBox1.Text)
__________________
Jason Hall
|

September 3rd, 2009, 01:46 PM
|
|
Authorized User
|
|
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Listbox
I have tried that and got 2 errors
Error 1 Property access must assign to the property or use its value.
Error 2 Name 'Items' is not declared.
|

September 3rd, 2009, 02:07 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
|
|
Hmm...
It works fine for me I just tested it?
Is lstDisplay a ListView object or is it a Form? because it looks almost as if it's a Form?
if that's the case then you need
lstDisplay.Show()
lstDisplay.ListView1.Items.Add(txtPerson.Text)
__________________
Jason Hall
|

September 3rd, 2009, 02:21 PM
|
|
Authorized User
|
|
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Listbox
It Was me I had it wrong like this
lstDisplay(Items.add(txtPerson.Text))
When it should have been like this
lstDisplay.Items.Add(txtPerson.Text)
Thank you so much for your help just beginning it should get better
Headworth
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |