Link to home
Start Free TrialLog in
Avatar of guicho
guicho

asked on

Toolbar in MDI Form

How can I execute a procedure from a child form clicking an icon in the toolbar into MDI Form???
Avatar of mcrider
mcrider

Let's say you have a procedure on a child form call "Child1" and the procedure is called "MyFunction"...


MyFunction should be declared as public...

Public Sub MyFunction()
'...
End Sub

then in the button, you can call:

Child1.MyFunction


Make sense?

Cheers!
Avatar of guicho

ASKER

The answer is correct, but I've 9 icons in the toolbar, how assign the procedure to the third icon???
ASKER CERTIFIED SOLUTION
Avatar of mcrider
mcrider

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of guicho

ASKER

The first answer was excellent, but in the second I can't select only the third icon click event, I resolved this way from MDIForm...

Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
    If Toolbar1.Buttons(3).Value = tbrUnpressed Then Child1.MyFunction
End Sub

But thank's a lot for your help...