Results 1 to 5 of 5

Thread: How Do I raise and event??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154

    How Do I raise and event??

    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!

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154
    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.

  4. #4
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    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?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154
    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.

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