Ok, how do i make so if ihave a form on and press a button and a new form opens on the right side of the first form and follows when i move the first form and also i cant move the second form from the side of the first one
frozie
0
Newbie Poster
Recommended Answers
Jump to Poston button click you just calculate the location of the new form:
newForm.Location= new point((alreadyOpenForm.location.X + alreadyOpenForm.Width),alreadyOpenForm.location.Y) newForm.Show
for keep this newForm sticking on the right you add a handler locationChanged for the alreadyOpenForm and set the location of newForm in there.
Jump to Postgo into your designer, select the form and change the name in its properties.
to declare it you simply do:
dim frm as new form1
then you just need to use frm instead of Form1 to call the function.
but this is ofc just a guess since you didnt show …
Jump to Postok....go to your solutions explorer, right click your main form and choose rename. rename it to something like "MainForm")
then in your code behind you add:
…Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form1 frm.Show(Me) End Sub
All 9 Replies
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
evisi
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
evisi
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
evisi
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
evisi
0
Newbie Poster
evisi
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.