|
-
Dec 6th, 1999, 09:12 PM
#1
Thread Starter
Member
I've got an MDI program with sub "child" windows. I need the program to run a sub when a particular key is pressed eg:
Private Sub Form_KeyDown
if keycode=100 then cmd_click
End Sub
Child forms will do this but no the MDI form. Unfortunately if I've got more than one child window open at once then the above code on one child will not work from another.
The keys need to do this through the whole program.
Any ideas?
-
Dec 6th, 1999, 10:25 PM
#2
Junior Member
I am not sure if there is an easy way of doing that. So here is my complex solution 
1. You can design a global message controller which can dispatch messages to all active forms.
2. You have to put the code to call the message controller in all child forms.
4. On all your form, add a command button (cmdExec) and make it invisible. Add the code you want to execute in the click event of the command button.
5. In the global controller, loop through the forms collection and execute the code:
Form(i).cmdExec.value=True
The above statement will cause the click event of cmdExec to execute.
HTH!!!
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
|