Results 1 to 2 of 2

Thread: Checkbox & Enter Key

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    11

    Lightbulb

    I used a "Checkbox" instead of a command button since I wanted to have a different font color and background. With the checkbox set to graphic, it looks exactly like a command button.

    Is there anyway to make it so that the "Enter" key, can be pressed instead of the User having to click on the checkbox button? There is no default for a Checkbox. I know that this can be done for a normal Command Button, but this is a Checkbox button.

    With this little program, the User enters a number into Text1, then clicks on the Check1 button, and the result is placed into Text2.

    Thank You.



  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    heu..
    try this ..

    Code:
    Private Sub Check1_keypress(KeyAscii as string)
    If KeyAscii = 13 then ' enter key number 
    keyascii=0 ' dont do any BEEP !
         If check1.value=checked then ' the check box is checked
              'The checkbox is checked an the user press ENTER
         else 
              'The checkbox is not checked and the user press ENTER
         end if
    end if
    end sub
    so just put what you want ..

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