Click here to Skip to main content
15,889,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am create one vb project toolbar add to mdi form and the toolbar using all child forms how is it possible plz help me.
Posted
Comments
Goutam Patra 18-Nov-10 8:15am    
VB6 is history.
Marc A. Brown 18-Nov-10 8:31am    
Dude, VB6 is only history if you don't have to maintain applications written in it. Some of us don't have that luxury.
Henry Minute 18-Nov-10 8:56am    
If there is such a thing, the best way to find out is to use a search engine.

1 solution

You can try doing it this way.
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    If Button.Caption = "save" Then
        Call mySave
    ElseIf Button.Caption = "new" Then
        Call myNew
    End If
End Sub

Sub mySave()
    If Me.ActiveForm Is Nothing Then Exit Sub
    Dim f As Form
    Set f = Me.ActiveForm
    Select Case f.Name
        Case "Form1"
            'do your save for form1
        Case "Form2"
            'do your save for form2
    End Select
End Sub

Sub myNew()
    If Me.ActiveForm Is Nothing Then Exit Sub
    Dim f As Form
    Set f = Me.ActiveForm
    Select Case f.Name
        Case "Form1"
            'do your new for form1
        Case "Form2"
            'do your new for form2
    End Select
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900