Results 1 to 9 of 9

Thread: Key press "enter"[RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Resolved Key press "enter"[RESOLVED]

    Hi to all:

    this is a small project with a few lines off code.The question is:

    I have in the begining off the code a few instructions to make the program works with the key "enter".This few lines off code works with others projets very well,but I don't now why,don't work with this one!


    I had add the code for simply verification!



    Thanks
    Attached Files Attached Files
    Last edited by sacramento; Dec 15th, 2004 at 08:12 PM.

  2. #2
    Hyperactive Member mudfish's Avatar
    Join Date
    Feb 2004
    Location
    Chit Chat
    Posts
    353

    Re: Key press "enter"

    Here a link to some key press info.
    http://vbforums.com/showthread.php?t...ight=key+press
    Mudfish AKA Bowfin
    I can spell "If" all day right, just a coder!


    "Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut." -- Ernest Hemingway

    Member of the ECCC

  3. #3
    Addicted Member nickname's Avatar
    Join Date
    Sep 2004
    Location
    Europe - Belgium
    Posts
    170

    Re: Key press "enter"

    When I want to verify which key is pressed I always use ascii..

    enter = 13 (I guess)

    It works fine wherever I use it!

    greetz

    nickname
    Software Engineer
    DBA
    Webdesigner
    --
    to code or to be coded, that's the question

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Key press "enter"

    Hi:

    Thanks for your help but I finc you don't had understand my problem:

    1 - I don't need to walk in the flexgrid with the key enter

    2 - I have a code to the key enter,and the code works fine in anotther projects.

    The problem is with particullary with this project,because I don't now why the key enter don't walk throught the text boxes,and when I press the enter key the focus jump to the flexgrid.

    If you run the project in attachament you can see this!

    Thanks

  5. #5
    Hyperactive Member mudfish's Avatar
    Join Date
    Feb 2004
    Location
    Chit Chat
    Posts
    353

    Re: Key press "enter"

    Sorry I am not very trusting, so I do not down load code.
    Post the code in question so I can look at it!.

    I thought that you want to capture the “enter” Key Press for a textbox.
    Mudfish AKA Bowfin
    I can spell "If" all day right, just a coder!


    "Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut." -- Ernest Hemingway

    Member of the ECCC

  6. #6
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Key press "enter"

    This is just a guess: set Form's KeyPreview property to True. And use code like this:

    Code:
    If KeyAscii = vbKeyReturn Then
    'do your stuff
    KeyAscii = 0
    End If
    KeyAscii = 0 should prevent anything from happening in the FlexGrid.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Key press "enter"

    Hi:

    Can you download the code,because it's too long to post,otherwise is a small part off a project,not the entire project!

    Thanks

  8. #8
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Key press "enter"

    The click event of any button whose Default property is True is fired when the Enter key is pressed. Command2 is your default button. The code in its click event sets focus to the FlexGrid.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Key press "enter"

    Thanks BruceVDe...you are right with your comments


    Thanks again

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