Results 1 to 7 of 7

Thread: list box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216

    list box

    Hi !

    how to set the list box so that it contains many fields.

    for ex (2 fields):

    file name Size
    ----------- ------
    Test.exe 10k
    ftp.lnk 1k

    etc....


    10x anyway !!

  2. #2
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    425
    As far as I can tell there is NO way. You should use the datagrid control to do such a thing...

    This is my knowladge though...
    "Experience is something you don't get until just after you need it."

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216
    I know, there is a way !!

    i had the code ... but i dont have it anymore !!

    anyway ...

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216
    anyone !?!?!?

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

    Play around with this...

    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2.  
    3. Private Const LB_SETTABSTOPS = &H192
    4. Private Sub Form_Load()
    5.    ReDim TabStop(0 To 2) As Long
    6.  
    7.   'assign some values to the tabs for the second third and fourth
    8.   'column (the first is flush against the listbox edge)
    9.    TabStop(0) = 90
    10.    TabStop(1) = 130
    11.    TabStop(2) = 185
    12.  
    13.   'clear then set the tabs
    14.    Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
    15.    Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(0))
    16.     List1.AddItem "Big" & Chr(9) & "Brown" & Chr(9) & "Dog"
    17.     List1.AddItem "Brown" & Chr(9) & "Big" & Chr(9) & "Dog"
    18.     List1.AddItem "Dog" & Chr(9) & "Brown" & Chr(9) & "Big"
    19.     List1.Refresh
    20. End Sub

  6. #6
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    VB Code:
    1. List1.Columns = 2

    but i have a feeling that isnt exactly what you wanted

  7. #7
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    425

    Re: Play around with this...

    Originally posted by Hack
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2.  
    3. Private Const LB_SETTABSTOPS = &H192
    4. Private Sub Form_Load()
    5.    ReDim TabStop(0 To 2) As Long
    6.  
    7.   'assign some values to the tabs for the second third and fourth
    8.   'column (the first is flush against the listbox edge)
    9.    TabStop(0) = 90
    10.    TabStop(1) = 130
    11.    TabStop(2) = 185
    12.  
    13.   'clear then set the tabs
    14.    Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
    15.    Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(0))
    16.     List1.AddItem "Big" & Chr(9) & "Brown" & Chr(9) & "Dog"
    17.     List1.AddItem "Brown" & Chr(9) & "Big" & Chr(9) & "Dog"
    18.     List1.AddItem "Dog" & Chr(9) & "Brown" & Chr(9) & "Big"
    19.     List1.Refresh
    20. End Sub
    Cool... Didn't knew that...
    "Experience is something you don't get until just after you need it."

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