Childform

  • Thread starter Thread starter Guest
  • Start date Start date
Dear Robbe,

This code doesn't brings my form on top, any idea what is wrong here?
If Not CheckOpenform(frmContract) Then
Dim ChildForm As New frmContract

ChildForm.MdiParent = Me
ChildForm.SuspendLayout()
ChildForm.Show()
ChildForm.ResumeLayout()
Else
frmContract.BringToFront()
End If
--
Best regards
Luc

Robbe Morris - [MVP] C# said:
form.BringToFront();

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
 
Is frmContract in the collection
of MDIChildren of your MDI form or
did you just create a new instance of it?

#region Get MDI Form By Name
private Form GetMDIFormByName(string formName)
{
foreach (Form form in this.MdiChildren)
{
if (form.Name == formName)
{
return form;
}
}

return null;

}
#endregion

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




Luc said:
Dear Robbe,

This code doesn't brings my form on top, any idea what is wrong here?
If Not CheckOpenform(frmContract) Then
Dim ChildForm As New frmContract

ChildForm.MdiParent = Me
ChildForm.SuspendLayout()
ChildForm.Show()
ChildForm.ResumeLayout()
Else
frmContract.BringToFront()
End If
--
Best regards
Luc

Robbe Morris - [MVP] C# said:
form.BringToFront();

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




Luc said:
How can I (programatically) bring a childform on top?
 
Back
Top