query on toolbar control

zarina

Member
Joined
Nov 30, 2005
Messages
8
Programming Experience
Beginner
hi,
I hav used a toolbar control in my application. On the toolbarbutton click event i need to open the respective forms.Its works fine but the problem raises when there is a need of closing my sub forms.THE toolbarbutton click actually hides the sub forms.I wan to know how to close the sub forms.
 
query

this is the code snippet i hav used in my application.with the properties in the form1,form2,form3,form4 as maximizebox,minimizebox,controlbox to be false and windows state to be maximum

Dim frmobj1 As New form1
frmobj1.MdiParent = Me
Dim frmobj2 As New form2
frmobj2.MdiParent =
Me
Dim frmobj3 As New form3
frmobj3.MdiParent = Me
Dim frmobj4 As New form4
frmobj4.MdiParent = Me

Dim ButtonPicked As ToolBarButton = e.Button
If (ButtonPicked.Equals(ToolBarButton1)) Then
frmobj1.Show()
ElseIf (ButtonPicked.Equals(ToolBarButton2)) Then
frmobj2.Show()
ElseIf (ButtonPicked.Equals(ToolBarButton3)) Then
frmobj3.Show()
ElseIf (ButtonPicked.Equals(ToolBarButton4)) Then
frmobj4.Show()
ElseIf (ButtonPicked.Equals(ToolBarButton5)) Then
End
End If


on the click event of the toolbarbutton2 i get my form2 opened its necessary for me to close that form.how can i close it wen i click al other buttons.
 
Back
Top