Results 1 to 6 of 6

Thread: Does VB have keystroke comand That?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2004
    Location
    So. Illinois USA
    Posts
    43

    Does VB have keystroke comand That?

    Is there any Function that stops and gets a keystroke, like suspend key in
    Dark Basic or waitkey in Blitz Basic?
    An Onion a Day Keeps every one Away!

  2. #2

  3. #3

    Thread Starter
    Member
    Join Date
    May 2004
    Location
    So. Illinois USA
    Posts
    43

    Re: Does VB have keystroke comand That?

    Thanks
    An Onion a Day Keeps every one Away!

  4. #4

    Thread Starter
    Member
    Join Date
    May 2004
    Location
    So. Illinois USA
    Posts
    43

    Re: Does VB have keystroke comand That?

    I use text boxes for keyboard input. I have a sequence that prints 4 different tables in a space where only 1 table will fit. Thus i have to use a for next loop and the sleep comand. The situatin would be much better if I had a waitkey comand to replace the sleep comand so the viewer could go on to the the next table whenever he wished>
    An Onion a Day Keeps every one Away!

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Does VB have keystroke comand That?

    Post your code to load textboxes. You can stop lines from appearing in the keypress routine, I'd think.

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Does VB have keystroke comand That?

    As I said you'd ahve to code it yourself - Do While loop comes to mind. Sleep wouldn't work for what you want to do - it simply suspends execution for specific number of milliseconds.
    So, what you might need to is to declare some boolean flag and when any of you "tables" entered set flag to true and begin looping until user responds somehow (hit Enter key or some "Continue" button on your form.
    Here is a quick sample:
    VB Code:
    1. Option Explicit
    2.  
    3. Dim blnStop As Boolean
    4.  
    5. Private Sub Text1_LostFocus()
    6.     blnStop = True
    7.     WaitForRespond 'or you may turn on timer for some number of seconds or minutes
    8. End Sub
    9.  
    10. Private Sub WaitForRespond()
    11.     Do While blnStop
    12.         DoEvents 'not best way all around but will work
    13.     Loop
    14. End Sub
    15.  
    16. 'you will have to come up with some idea on how to let user continue
    17. 'so you would stop looping and get next entry in that textbox
    18.  
    19. '...

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