Help in Form manipulation

I want to have my child form to hide itself in the event of toolstrip

Page 1 of 1

2 Replies - 1303 Views - Last Post: 18 October 2008 - 03:27 AM Rate Topic: -----

#1 kalabidong   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-August 08

Help in Form manipulation

Posted 14 October 2008 - 11:45 AM

How can I make a child form hide everytime I click on a toolstrip menu?
It's like I have a parent form with toolstrip in it and the moment it loads it shows child form 1.
Then if i click on the child form 2 on toolstrip menu, child form 1 will hide itself, and vice versa.

i have this code:

 Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
		Dim perry As main
		perry = New main
		perry.MdiParent = Me
		perry.Show()
	End Sub

	Private Sub ToolStripLabel3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel3.Click
		Dim perry As unhide
		perry = New unhide
		perry.MdiParent = Me
		perry.Show()
	End Sub


how to do it?

Is This A Good Question/Topic? 0
  • +

Replies To: Help in Form manipulation

#2 jg007   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 26
  • Joined: 23-March 08

Re: Help in Form manipulation

Posted 14 October 2008 - 12:15 PM

I am not completely sure what you are trying but try this code with the form names replaced with whatever yours are called

	Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		Form3.MdiParent = Me
		Form2.MdiParent = Me
	End Sub

	Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
		If Form3.Visible Then Form3.Hide()
		Form2.Show()
								
								' and because I hated the form position changing :)
								Form2.Location = New System.Drawing.Point(0, 0) 

	End Sub

	Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
		If Form2.Visible Then Form2.Hide()
		Form3.Show()
								Form3.Location = New System.Drawing.Point(0, 0) 


	End Sub



This post has been edited by jg007: 14 October 2008 - 12:17 PM

Was This Post Helpful? 0
  • +
  • -

#3 kalabidong   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-August 08

Re: Help in Form manipulation

Posted 18 October 2008 - 03:27 AM

Its not working well but thanks anyways. I used your code in the location.. :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1