• 0

[C#] Label beside TabControl


Question

Hi all,

I am trying to place a label beside a tab control like the image(sample) below.

I placed the label but the label goes behind the tab control. These are the methods i tried to bring the control front but it is not getting displayed.

none worked


this.labelControl2.BringToFront();
[/CODE]

then i tried to invalidate for a repaint

[CODE]
this.labelControl2.Invalidate();
[/CODE]

I also tried to set the child index so that the label is the first control and will be displayed above all control like this

[CODE]
Parent.Controls[0].Controls[0].Controls[0].Controls.SetChildIndex(labelControl2, 0);
[/CODE]

A click on a hyperlink in one of the tab should invoke the label and display the name of the link on the label.

That's my requirement but i couldn't get the label displayed.

even tried to repaint the label manually.I am using dev express tabControl just an fyi.

post-312866-0-52615100-1328300508.jpg

Link to comment
https://www.neowin.net/forum/topic/1055880-c-label-beside-tabcontrol/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I just did this myself... I added the Label control only after having added the TabControl. You can lay them on the canvas respectively; by default, they both render simultaneously as long as the tabs do not sit on top of the label.

EDIT: I now realize you're using the DevExpress TabControl. Why? That's the real problem, because it's basically a custom control. Try using the native controls first. That should have been highlighted FIRST as it's a separate control than the MSFT ones.

  • 0

Could you confirm whether thats WPF or WinForms.

Thanks

GE

Its winform build with devxpress controls.

I just did this myself... I added the Label control only after having added the TabControl. You can lay them on the canvas respectively; by default, they both render simultaneously as long as the tabs do not sit on top of the label.

EDIT: I now realize you're using the DevExpress TabControl. Why? That's the real problem, because it's basically a custom control. Try using the native controls first. That should have been highlighted FIRST as it's a separate control than the MSFT ones.

I cannot remove the devxpress tabcontrol to use native tab control. those module were already in there and i am trying to add some functionality to it.

The whole application is build on devexpress and has been here for few years now so removing them is not an option.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.