Click to See Complete Forum and Search --> : How Do I raise and event??
Neumee
Jan 14th, 2003, 12:23 AM
What I want to do is...... when I press the downkey/upkey in the form_keydown event I want have that do that same as clicking the corresponding scroll bar.
I have to scroll bars....one that is used to navigate up records in the datagrid, and one that is used to navigate down records in the datagrid. Maybe I don't need to raise an event?? If there is a better way, or if this is the correct way, Please let me know.
Thanks in advance!
Athley
Jan 14th, 2003, 01:29 AM
In cases like this I often create an independant sub that controls the things I want to do from more than one place in code, and call that sub from the different events. Is that possible in your case maybe?
Else I think it should be possible to fire events through delegates.
Neumee
Jan 14th, 2003, 10:06 AM
I'm not sure exactly what you mean. If you could post an example that would be great. I dont know what a Delegate is?
I have created modules before that allow me to call them from different functions/events in the project. But I dont know how to make it so it calls the VScroll1_Scroll event. Thanks again.
Athley
Jan 15th, 2003, 01:21 AM
Well if you put the code you have in that scroll event outside the event you wouldn't have to call it the event, would you? If that is possible in your case?
Neumee
Jan 15th, 2003, 10:40 AM
Your right, I wouldn't have to call the scrollbar_event. The code that is in the event is calling another function called GetData()......the reason I want to call the scroll bar event is because when I use the scroll bars to navigate through my records, it seems to work really fast. .... But if I call the same getdata() function in the form_key_down event for the UP/Down keys, then my records scroll chopppy and slow for some reason.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.