-
June 30th, 2010, 10:14 AM
#1
[RESOLVED] Help with events
I have trapped the KeyDown event for my program. It detects the keypress properly. What I'd like to do after that is go and refresh the screen, a function called drawGame. The problem is that the keypress function is in frmgame.vb and the drawGame funciton is in clsGameEngine.vb, and the one can't see the other.
Once I've clicked on the screen, the updates I've set in motion work; what I'd like to have is a function similar to the mouseclick, but one which triggers off the pc clock, i.e., refreshing every two seconds or so.
However it does it, it MUST call back to the drawGame function; what I'm unsure of is how to get there from here. Can anyone help?
-
June 30th, 2010, 05:38 PM
#2
Re: Help with events
Actually, (chagrined smile) I answered my own question.
the gameEngine . (dot operator) accessed a few functions already. One of those functions was the one that initialized the game. All I had to do was to make my drawGame function public, and voila! It was available under the dot operator, as follows:
gameEngine.drawGame()
It's important for newbies to understand the mechanics of how one section can call functions in another. Perhaps someone will write a tutorial on this. Thanks!
-
June 30th, 2010, 07:52 PM
#3
Re: [RESOLVED] Help with events
Also should note that this is apparently referring to dot net rather than VB6
Always use [code][/code] tags when posting code.
-
July 3rd, 2010, 12:21 AM
#4
Re: [RESOLVED] Help with events
Please reread forum rules and then correct your post using correct code Tags BTW
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
|