Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,417 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,355 people online right now. Registration is fast and FREE... Join Now!




Help in Form manipulation

 
Reply to this topicStart new topic

Help in Form manipulation, I want to have my child form to hide itself in the event of toolstrip

kalabidong
14 Oct, 2008 - 10:45 AM
Post #1

New D.I.C Head
*

Joined: 23 Aug, 2008
Posts: 7

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:

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?

User is offlineProfile CardPM
+Quote Post

jg007
RE: Help In Form Manipulation
14 Oct, 2008 - 11:15 AM
Post #2

New D.I.C Head
*

Joined: 23 Mar, 2008
Posts: 26



Thanked: 1 times
My Contributions
I am not completely sure what you are trying but try this code with the form names replaced with whatever yours are called

CODE


    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 Oct, 2008 - 11:17 AM
User is offlineProfile CardPM
+Quote Post

kalabidong
RE: Help In Form Manipulation
18 Oct, 2008 - 02:27 AM
Post #3

New D.I.C Head
*

Joined: 23 Aug, 2008
Posts: 7

Its not working well but thanks anyways. I used your code in the location.. biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 01:00PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month