i've got the code for showing forms in panel but the problem is i want the form to appear only once even if the button is clicked many times.
here's the code.. hope someone could help me...
Sub LoadFormsInPanel(ByVal container As Panel, ByVal formType As Type)
Dim ypos As Integer = 0
container.Visible = False
For index As Integer = 0 To index = 1 'dataArray.Length - 1
'Create an instance of the form via Reflection.
Dim frm As Form = DirectCast(Activator.CreateInstance(formType), Form)
'Drop titlebar and border and make it a non-toplevel form.
frm.FormBorderStyle = FormBorderStyle.None
frm.TopLevel = False
'Set its position and size.
frm.Top = ypos
frm.Width = container.Width - 4
'Add the form to the panel and make it visible.
container.Controls.Add(frm)
frm.Visible = True
'Prepare position of next form.
ypos += frm.ClientSize.Height
Next
container.Visible = True
End Sub
here's the code.. hope someone could help me...
Sub LoadFormsInPanel(ByVal container As Panel, ByVal formType As Type)
Dim ypos As Integer = 0
container.Visible = False
For index As Integer = 0 To index = 1 'dataArray.Length - 1
'Create an instance of the form via Reflection.
Dim frm As Form = DirectCast(Activator.CreateInstance(formType), Form)
'Drop titlebar and border and make it a non-toplevel form.
frm.FormBorderStyle = FormBorderStyle.None
frm.TopLevel = False
'Set its position and size.
frm.Top = ypos
frm.Width = container.Width - 4
'Add the form to the panel and make it visible.
container.Controls.Add(frm)
frm.Visible = True
'Prepare position of next form.
ypos += frm.ClientSize.Height
Next
container.Visible = True
End Sub