Results 1 to 9 of 9

Thread: List Boxes

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    List Boxes

    i want to convert text box inputs into a list box. i have 7 text boxes like; fname, lname , email, phone, etc


    how would would i call those textboxes into a list box. also it it possible to make headers for the the listbox.

    Thanks for the help!

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: List Boxes

    If you are talking about headers for a Listbox, think about using either a DataGridView or a ListView (in Detail mode) instead. Both of those have headers, whereas a Listbox will not.

    And considering that suggestion, there is hardly any point in answering the original question. After all, if you decide that headers are important, then the means of entering data into a listbox isn't important, since entering data into a ListView or DGV would be considerably different, so which would you really like?
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    Re: List Boxes

    what i was trying to say was if i enter the data

    Joe Doe
    [email protected]
    555-555-5555

    each input has a seperate textbox for name , email, phone, how would i get that information into a listbox. So whatever the enter will be put in to the listbox.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List Boxes

    You can do
    Code:
    ListBox1.Items.Add Textbox1.text & " " & Textbox2.Text & " " & TextBox3.text
    But, as ShaggyHiker points out, you can't do headers with a listbox and your entries will not be uniform.

    I echo the suggestion of switching to either a datagridview or a Listview (in Details mode)

  5. #5
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: List Boxes

    Your question is a bit confusing? As Shaggy said ListBox doesnt have headers, so DGV would be a better option if your looking for Headers

    In your post#3 you seem to be asking how to get TextBox info into a list box and doesnt mention headers?
    With that said here is simple idea to put textbox info into to a list box

    Code:
    Me.ListBox1.Items.Add(Me.TextBox1.Text)
            Me.ListBox1.Items.Add(Me.TextBox2.Text)
    Hope this helps
    Last edited by billboy; Nov 29th, 2011 at 02:53 PM.

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    Re: List Boxes

    Thank You! ..... also what if i am using seperate forms do i need to do something else like friend?

  7. #7
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: List Boxes

    Quote Originally Posted by clintc10 View Post
    Thank You! ..... also what if i am using seperate forms do i need to do something else like friend?
    you mean your textboxes are on different forms? try to be more clear when asking a question, take a few extra minutes to write out your question and re-read it to yourself and ask yourself, if you were reading it would it make sense to you??

    If you have textboxes on seperate form

    just reference the form


    Form3.TextBox1.Text etc.. (Form3)or what ever form the textbox is on

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    Re: List Boxes

    MembersForm.MemberListBox.Items.Add(FNameTextBox.Text & " " & LNameTextBox.Text)


    This is what i have and it is not working.

    I have a membership form and a members form.

    The textboxes are in the membership form and the listobx is on the members form.

  9. #9
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: List Boxes

    Quote Originally Posted by clintc10 View Post
    MembersForm.MemberListBox.Items.Add(FNameTextBox.Text & " " & LNameTextBox.Text)


    This is what i have and it is not working.

    I have a membership form and a members form.

    The textboxes are in the membership form and the listobx is on the members form.
    Dont know what form your code is on but you probably need to reference the textboxes like this

    Membership.FNameTextBox1.Text & "" & Membership.LNameTextBox.Text

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width