Form location Inside Panel
I have this little problem about my 2nd form location inside a panel on debug mode...
I made a panel inside my main form and set a button for it so that when the button is clicked my 2nd form will show inside my panel..
It works well so far.. the 2nd form appears inside the panel.. But here comes my problem.. The location of the 2nd form..
Here's the image example of my problem..
![Name: Problem.PNG
Views: 4
Size: 12.7 KB]()
You see it's not fitted correctly inside my panel when i clicked the button..
Is there a way for the 2nd form to show perfectly occupying the panel size on debug mode like this image sample...?
This is what I'd like my form to show when I clicked the button..(EDITED IMAGE)
![Name: Correct.PNG
Views: 4
Size: 14.3 KB]()
Here's my code inside button clicked
Private Sub Prep_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Prep.DoubleClick
Dim myForm As New Testform
myForm.TopLevel = False
Panel1.Controls.Add(myForm)
myForm.Show()
End Sub
I already tried the Testform.Location = New Point (0, 0) sample code.. but no good..
By the way my main form and 2nd form are both custom movable borderless form..
I'm using visual studio 2010 vb
I'm new to VB.net programming so I'm kinda lost here and needed your help so bad thanks in advance..
I have this little problem about my 2nd form location inside a panel on debug mode...
I made a panel inside my main form and set a button for it so that when the button is clicked my 2nd form will show inside my panel..
It works well so far.. the 2nd form appears inside the panel.. But here comes my problem.. The location of the 2nd form..
Here's the image example of my problem..
You see it's not fitted correctly inside my panel when i clicked the button..
Is there a way for the 2nd form to show perfectly occupying the panel size on debug mode like this image sample...?
This is what I'd like my form to show when I clicked the button..(EDITED IMAGE)
Here's my code inside button clicked
Private Sub Prep_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Prep.DoubleClick
Dim myForm As New Testform
myForm.TopLevel = False
Panel1.Controls.Add(myForm)
myForm.Show()
End Sub
I already tried the Testform.Location = New Point (0, 0) sample code.. but no good..
By the way my main form and 2nd form are both custom movable borderless form..
I'm using visual studio 2010 vb
I'm new to VB.net programming so I'm kinda lost here and needed your help so bad thanks in advance..