|
-
Oct 12th, 2000, 10:13 AM
#1
Thread Starter
Fanatic Member
Is there a way to trigger an event on another form when that form isn't active? I've got a program with an MDI form and a few children, and I want to be able to fire an event in one of the children when the MDI form has the focus. (Specifically using an MDI menu to press a toolbar button on one of the child forms). I know that properties can be set with the syntax Form!Object.Property = Value, but that same thing won't work for firing events. Is it possible to do this?
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Oct 12th, 2000, 03:11 PM
#2
Just change it from Private Sub to Public Sub, for example:
Code:
Public Sub Command1_Click()
MsgBox "Hello"
End Sub
Then from another Form, you can use:
Code:
Call Form2.Command2_Click()
-
Oct 12th, 2000, 03:21 PM
#3
transcendental analytic
Code:
Command1.Value = True
will also trigger the commandbutton click event without setting it public
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|