Results 1 to 4 of 4

Thread: Moving focus in AciveX control

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Asheville, nc
    Posts
    53

    Exclamation Moving focus in AciveX control

    Hi everyone
    I am developing an AciveX control with many text boxes and check boxes. When user hit ENTER, focus should move to the next box in the ActiveX control. I don't know how to do this.
    Please help me.
    Victor

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I think this is what you want:

    VB Code:
    1. Private Sub Text1_KeyPress(KeyAscii As Integer)
    2.     If KeyAscii = vbKeyReturn Then Text2.SetFocus
    3. End Sub
    4.  
    5. Private Sub Text2_KeyPress(KeyAscii As Integer)
    6.     If KeyAscii = vbKeyReturn Then Text3.SetFocus
    7. End Sub
    8.  
    9. Private Sub Text3_KeyPress(KeyAscii As Integer)
    10.     If KeyAscii = vbKeyReturn Then Text4.SetFocus
    11. End Sub

    etc, etc.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Asheville, nc
    Posts
    53
    Thanks Rick Bull
    I am using something like this.
    My OCX will work in COBOL program. Another programmer needs to test this. I don't know now, will COBOL treat OCX as one control or will it allow to go thru all boxes on my OCX.
    Thanks again.
    Victor

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Sorry I haven't got a clue. I thought COBOL was command line stuff only

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