In addition to using SplitContainer, is there any other way to place a Form inside another form, using HTML-style iframe? For the SplitContainer I am not able to change the data of the Form inside it.
In addition to using SplitContainer, is there any other way to place a Form inside another form, using HTML-style iframe? For the SplitContainer I am not able to change the data of the Form inside it.
I've been researching, there are many ways to accomplish this, here is a list of possibilities and attempts you can make:
Place this method in the base class (where you will add the controls):
Public Function PerformControls(ByVal Expression As Form) As Control
Dim tmp As New Control With
{
.Size = Expression.Size,
.Location = Expression.Location,
.Cursor = Expression.Cursor,
.Font = Expression.Font,
.BackColor = Expression.BackColor,
.ForeColor = Expression.ForeColor
}
For Each item As Object In Expression.Controls
tmp.Controls.Add(item)
Next
Return tmp
End Function
To use, try this:
Private Sub Form_Load(sender As [Object], e As EventArgs) Handles MyBase.Load
Me.Controls.Add(PerformControls(New FormDest)) 'FormDest é o nome da classe destino
End Sub
Example II
Add this function:
Public Shared Sub ShowFormInControl(ByRef ctl As Control, ByRef frm As Form)
If ctl IsNot Nothing AndAlso frm IsNot Nothing Then
frm.TopLevel = False
frm.FormBorderStyle = FormBorderStyle.None
frm.Dock = DockStyle.Fill
frm.Visible = True
ctl.Controls.Add(frm)
End If
End Sub
To use:
Private Sub Form_Load(sender As [Object], e As EventArgs) Handles MyBase.Load
ShowFormInControl(Me, New frmDest)
End Sub
Try to do this, good luck.