• 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.
  • Posts

    • I miss when there was blue and red and green devices. Now we get sand black or silver.... just like most car lots now.
    • Microsoft should never have purchased anything after RARE.
    • Call of Duty: Vanguard, EA Sports FC 26, and more come to Xbox Game Pass by Pulasthi Ariyasinghe Microsoft is in the process of making some big changes to Xbox Game Studios right now, which might include studio shutdowns, but Game Pass drops aren't pausing for that. The second wave of June was just announced, unveiling another Call of Duty addition, the latest soccer game from EA, an indie road trip hit from last year, and more. While Microsoft said it won't put Call of Duty titles on Game Pass on the day of launch anymore, older titles keep landing, with the latest one being 2021's Call of Duty: Vanguard. Here are all the games that were announced today for Xbox Game Pass, their platforms, and arrival dates: Junkster (Cloud, XBOX Series X|S, Handheld, and PC) – June 16 Call of Duty: Vanguard (Cloud, Console, and PC) – June 17 EA Sports FC 26 (Cloud, Console, and PC) – June 18 Abyssus (Cloud, Xbox Series X|S, and PC) – June 25 RV There Yet? (Cloud, Xbox Series X|S, and PC) – June 30 Tony Hawk's Pro Skater 3 + 4 (Cloud, Console, and PC) – July 2 Winds of Arcana: Ruination (Cloud, Console, Handheld, and PC) – July 6 From the bunch, Junkster is the sole day-one drop into Game Pass libraries of this selection. As new games arrive, eight will be leaving the Game Pass programs on June 30. Here's the full list of leaving titles: Mecha Break (Cloud, Console, and PC) Payday 2 (Console) Rise of Tomb Raider (Cloud, Console, and PC) Tomb Raider (Cloud, Console, and PC) Slay the Spire (Cloud, Console, and PC) Ultimate Chicken Horse (Cloud, Console, and PC) Volcano Princess (Cloud, Console, and PC) Unpacking (Cloud, Console, and PC) With June drops finished, Microsoft should have a new Game Pass announcement in about two weeks to reveal the first wave of games coming to subscribers in July. Already confirmed games for the month include the Halo: Campaign Evolved remake, Corsair Cove, SpeedRunners 2: King of Speed, and Mistfall Hunter.
  • Recent Achievements

    • One Year In
      Console General earned a badge
      One Year In
    • One Year In
      Twozo Technologies earned a badge
      One Year In
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
    • Veteran
      branfont went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      522
    2. 2
      +Edouard
      201
    3. 3
      PsYcHoKiLLa
      111
    4. 4
      Steven P.
      89
    5. 5
      Nick H.
      71
  • Tell a friend

    Love Neowin? Tell a friend!