Making Control Topmost

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know that Windows Forms provide a TopMost property to ensure it is on top.
How can I force a Control to be TopMost? I have a usercontrol that will be
consumed by several forms and I need it to remain the topmost control when it
appears on a form even though other controls may be added to the form during
design time. How can I bring a control to the front, or keep it in front?
 
So what you're suggesting is to have the control programatically reorder all
other controls on the form at runtime? It must be done at run-time since the
control appears on a form which is inherited and controls that are part of
the base form always have presidence of display by default. I will have to
test and see if your solution works at runtime.
 
Matthew,
Instead of directly manipulating controls collection, you may want to try
BringToFront() and SendToBack() methods of your container control.

Thx,
Deniz
 
Back
Top