Results 1 to 8 of 8

Thread: [RESOLVED] listBox - problem

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Resolved [RESOLVED] listBox - problem

    Hi

    I have something like this

    Code:
    Option Explicit
    
    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
    
    Private Sub Command1_Click()
    Unload Me
    End Sub
    
    Private Sub Form_Load()
        Dim nTabArray(1) As Long 'Two tab stops (= 3 columns)
        Const LB_SETTABSTOPS As Long = &H192
        
        nTabArray(0) = 33
        nTabArray(1) = 210
        
        'Clear any existing tabs
        'and set the list tabstops
        Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
        Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 2&, nTabArray(0))
        List1.Refresh
        'add some dummy data
        List1.AddItem "1" & vbTab & "Apples" & vbTab & "$2.98"
        List1.AddItem "2" & vbTab & "Chocolate" & vbTab & "$4.50"
        List1.AddItem "3" & vbTab & "Yoghurt" & vbTab & "$4.90"
        List1.AddItem "4" & vbTab & "Coffee" & vbTab & "$19.98"
        List1.AddItem "5" & vbTab & "Mango" & vbTab & "$2.00"
        List1.AddItem "6" & vbTab & "Bananas" & vbTab & "$1.89"
        List1.AddItem "7" & vbTab & "Olives" & vbTab & "$7.12"
    End Sub
    
    Private Sub List1_Click()
        Dim sItems() As String
        Dim i As Long
        sItems = Split(List1.Text, vbTab)
        For i = 0 To 2
            Text1(i).Text = sItems(i)
        Next
    End Sub
    how to make that every clicking it can do wrote into the next row with textboxes with next numb er ordinal.
    Attached Images Attached Images  
    I know, I know, my English is bad, sorry .....

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