Making Control Topmost

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?
 
B

Bob Powell [MVP]

G

Guest

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.
 
G

Guest

Matthew,
Instead of directly manipulating controls collection, you may want to try
BringToFront() and SendToBack() methods of your container control.

Thx,
Deniz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top