Windows Develop Bookmark and Share   
 index > Windows Forms Designer > manual position of Form2 from Form1
 

manual position of Form2 from Form1

Hello to All,

I m trying to capture the Position of one label .

Acctually i have 2 forms(not MDI form)

a.Form1 (label1 , button1)

b.Form2 (button1 )

i click on the button of Form1(which open Form2).

Now i want 2 open dat Form2 from the same point where the label1 is positioned in my Form1 Or Center Bottom OfForm1.

like the same as Winap playlist ,Comes in the Bottom of Winap Player.


Thanks in Advance









PraveenRockz
i m Doing Software Engi.(GNIIT).. I Lov 2 Do Programming...n i Want be a HacKer..
PraveenRockz  Thursday, January 15, 2009 7:01 AM
Hi.

Here the code you need:

PublicClassForm1
PrivateWithEventsfrm2AsNewForm2
PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
frm2.Show()
frm2.Top=Me.Top+Me.Height
frm2.Left=Me.Left+Me.Width/2-frm2.Width/2
EndSub
PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Click
frm2.Show()
frm2.Top=Me.Top+Label1.Top+Label1.Height
frm2.Left=Me.Left+Label1.Left
frm2.BringToFront()
EndSub
EndClass
ie israel  Thursday, January 15, 2009 3:52 PM
Hi.

Here the code you need:

PublicClassForm1
PrivateWithEventsfrm2AsNewForm2
PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
frm2.Show()
frm2.Top=Me.Top+Me.Height
frm2.Left=Me.Left+Me.Width/2-frm2.Width/2
EndSub
PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Click
frm2.Show()
frm2.Top=Me.Top+Label1.Top+Label1.Height
frm2.Left=Me.Left+Label1.Left
frm2.BringToFront()
EndSub
EndClass
ie israel  Thursday, January 15, 2009 3:52 PM

You can use google to search for other answers

Custom Search

More Threads

• Iterating DesignerSerializationVisibility.Content collections?
• ComboBox.SelectedIndexChanged event
• Disable Move feature in design surface
• Creating my own TabPage class
• Update Form Graphics Before It's Displayed
• Get the title of a child form of another application
• Ressources embedded problem with a compilation on the fly
• how to play the flash videos in the Windows Forms?
• Form Inheritance and Inheritance Picker problem
• Custom DataGridView Columns