|
-
Jan 24th, 2004, 07:04 AM
#1
Thread Starter
Addicted Member
stupid, but i know someone can help ...
hello everyone !
i've a cmd_PageDown button on a form, which is hidden.
i'm trapping the pagedown key of keyboard and caling the cmdPageDown_click
(i'm using pagedown to scroll down a picturebox control, its my application's demand !!)
now my problem is that if a keep the pagedown key pressed continously, till the key is remain pressed, it will not display the page of the picturebox. only when i release the key , can i see the final page.
is there any way by which, while my key is pressed, the command button is called continously and i can see the effect also simultaneously.
its quite imp !!!!
pls help
shruti !
-
Jan 24th, 2004, 07:19 AM
#2
PowerPoster
There might be other better methods, but one thats coming to my mind right now, is that u keep a timer, and enable it the moment the pagedown key is pressed, and disable it on when the key up event.
In the timer event code, u can keep calling the btnPageDown_click sub, to get the desired effect
-
Jan 24th, 2004, 11:43 AM
#3
My suggestion would depend on the structure of the program. What I am thinking of would be that you set a global boolean on the KeyDown event, then clear the boolean on the KeyUp event. Have a function running a perpetual loop (or start a perpetual loop on the keydown event) that keeps recalling the desired function. You would also want a DoEvents in the loop, or else the thing would never end.
Having written that, it seems that the simplest way would be for the keydown event to set a boolean and call a sub that started the perpetual loop. The loop continues while the boolean is True. The KeyUp event would set the boolean to False, which would terminate the perpetual loop. It's a bit ugly, but functional.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|