Results 1 to 3 of 3

Thread: Need simple help w/ lists

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    NJ
    Posts
    49

    Need simple help w/ lists

    What would i use for the text that is being highlighted in a list?
    (ex-- List1.????)

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Type in List1.
    and you will see a list of available methods etc.

    eg.
    VB Code:
    1. Private Sub Form_Load()
    2.     List1.AddItem "test"
    3. End Sub
    4.  
    5. Private Sub Command1_Click()
    6.     Text1.Text = List1.List(0)
    7. End Sub
    ________
    FAT GIRL LIVE
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:12 AM.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Better example:
    VB Code:
    1. Private Sub Form_Load()
    2.     With List1
    3.         .AddItem "One"
    4.         .AddItem "Two"
    5.         .AddItem "Three"
    6.     End With
    7. End Sub
    8.  
    9. Private Sub List1_Click()
    10.     Text1.Text = List1.List(List1.ListIndex) ' Places the Selected item in the TextBox
    11. End Sub

    ListIndex is the returned 'index' of a 'selected' List item
    ________
    Herbalaire review
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:13 AM.

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