Results 1 to 6 of 6

Thread: Resolved * Thank You* Textbox Arrays and Listboxes

Threaded View

  1. #1

    Thread Starter
    Addicted Member Renee K's Avatar
    Join Date
    Jun 2002
    Posts
    163

    Resolved * Thank You* Textbox Arrays and Listboxes

    I am fairly new to arrays, and try to avoid them because I always get stuck in positions like this.

    I have and array of 8 textboxes and by double clicking on any of the textboxes a list box will appear. Well my problem is how do I put the listbox selection into the textbox it was called from, and how do I set focus back to the textbox?

    Code:
    Private Sub lstCode_DblClick()
        For i = 0 To lstCode.ListCount - 1        'Loop to find selection
            If lstCode.Selected(i) = True Then    'If selected
                For j = 0 To txtCode.Count - 1
    '******************************************
    'NEED TO DETERMINE HOW TO PLACE SELECTED VALUE IN 
    'ORIGINAL TEXT BOX
    '******************************************
    
                    If txtCode(j).   Then
                        txtCode(j).Text = lstCode.Text   'Display selection
                    End If
                Next j
            End If
        Next i
        lstCode.Visible = False                   'Hide lstbox
    '***************************************
    'NEED TO SET FOCUS BACK TO ORIGINAL TEXT BOX
    '******************************************
        For j = 0 To txtTestCode.Count - 1
            txtTestCode(j).SetFocus
        Next j
    End Sub
    Thank you
    Last edited by Renee K; Oct 2nd, 2002 at 05:07 PM.
    .·*¨) ¸.·*¨) ¸.·*¨*
    (¸.*´ ¸.·´*'~*Renee~* (¸.*´~*



    Funny how the little things can stop you dead in your tracks.

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