p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 3rd, 2009, 12:00 PM
Authorized User
Points: 79, Level: 1
Points: 79, Level: 1 Points: 79, Level: 1 Points: 79, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Question 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 3rd, 2009, 01:28 PM
Friend of Wrox
Points: 788, Level: 10
Points: 788, Level: 10 Points: 788, Level: 10 Points: 788, Level: 10
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 3rd, 2009, 01:35 PM
Authorized User
Points: 79, Level: 1
Points: 79, Level: 1 Points: 79, Level: 1 Points: 79, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Red face Listbox

I am trying to show the value in textbox in listbox
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old September 3rd, 2009, 01:39 PM
Friend of Wrox
Points: 788, Level: 10
Points: 788, Level: 10 Points: 788, Level: 10 Points: 788, Level: 10
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
Default How about this..

How about something like this?

ListView1.Items.Add(TextBox1.Text)
__________________
Jason Hall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old September 3rd, 2009, 01:46 PM
Authorized User
Points: 79, Level: 1
Points: 79, Level: 1 Points: 79, Level: 1 Points: 79, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old September 3rd, 2009, 02:07 PM
Friend of Wrox
Points: 788, Level: 10
Points: 788, Level: 10 Points: 788, Level: 10 Points: 788, Level: 10
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old September 3rd, 2009, 02:21 PM
Authorized User
Points: 79, Level: 1
Points: 79, Level: 1 Points: 79, Level: 1 Points: 79, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jul 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Angry 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo field doesn't show in Listbox Grafixx01 Access 2 May 31st, 2007 08:16 PM
listbox/Textbox/sql Rudner VB How-To 0 March 9th, 2005 02:44 AM
show date in textbox yengzhai ASP.NET 1.1 4 February 15th, 2005 11:45 AM
Listbox/textbox johnjohn Classic ASP Basics 4 December 11th, 2004 12:14 AM
Listbox to textbox Freddyfred Access VBA 2 May 10th, 2004 11:37 PM



All times are GMT -4. The time now is 01:28 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc