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?

Re: Making Control Topmost by Bob

Bob
Mon Nov 27 17:55:04 CST 2006

Re-order the list of child controls so it's the first.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"Matthew Wieder" <MatthewWieder@discussions.microsoft.com> wrote in message
news:B152946D-1C6E-4BFC-906B-CBBC657E86D9@microsoft.com...
>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?



Re: Making Control Topmost by MatthewWieder

MatthewWieder
Mon Nov 27 19:24:01 CST 2006

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.

"Bob Powell [MVP]" wrote:

> Re-order the list of child controls so it's the first.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Ramuseco Limited .NET consulting
> http://www.ramuseco.com
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tipstricks.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/faqmain.htm
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
> "Matthew Wieder" <MatthewWieder@discussions.microsoft.com> wrote in message
> news:B152946D-1C6E-4BFC-906B-CBBC657E86D9@microsoft.com...
> >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?
>
>
>

Re: Making Control Topmost by Deniz

Deniz
Mon Dec 04 02:13:00 CST 2006

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

Thx,
Deniz


"Matthew Wieder" wrote:

> 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.
>
> "Bob Powell [MVP]" wrote:
>
> > Re-order the list of child controls so it's the first.
> >
> > --
> > Bob Powell [MVP]
> > Visual C#, System.Drawing
> >
> > Ramuseco Limited .NET consulting
> > http://www.ramuseco.com
> >
> > Find great Windows Forms articles in Windows Forms Tips and Tricks
> > http://www.bobpowell.net/tipstricks.htm
> >
> > Answer those GDI+ questions with the GDI+ FAQ
> > http://www.bobpowell.net/faqmain.htm
> >
> > All new articles provide code in C# and VB.NET.
> > Subscribe to the RSS feeds provided and never miss a new article.
> >
> >
> >
> > "Matthew Wieder" <MatthewWieder@discussions.microsoft.com> wrote in message
> > news:B152946D-1C6E-4BFC-906B-CBBC657E86D9@microsoft.com...
> > >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?
> >
> >
> >