user912447
user912447

Reputation: 706

Keep Label on top of TabControl .NET

I have a label that I need to stay on top of my TabControl as I switch from tab to tab. I have tried calling the Label's BrintToFront method in the SelectedIndexChanged Event of the Tab Control but this has no effect. I also simply tried right clicking my label in design view and selecting "Bring to Front" but again, this had no effect.

When I switch to my second tab it drops behind the TabControl however, when I go back to my first tab it is in front again.

I placed the label itself on the Form rather than on the TabControl.

I am working in C#. Any ideas would be greatly appreciated. Thanks.

Upvotes: 1

Views: 2255

Answers (1)

Steve0
Steve0

Reputation: 2243

You should make sure that your label is not located inside a specific tab. To verify this you need to look at the nesting inside the 'document outline' (ctl+alt+T)

If it is I recommend; dragging it just outside the tab control (you can also use the document outline). then 'bring it to the front'. and then use the arrow keys, or location property, to move it back into position.

Upvotes: 5

Related Questions