ITC Judge Bans Xbox in Back Page News

[C#] Label beside TabControl


6 replies to this topic - - - - -

#1 still1

    Neowinian UNSTOPPABLE

  • 6,011 posts
  • Joined: 30-September 09
  • Location: United States

Posted 03 February 2012 - 20:22

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();

then i tried to invalidate for a repaint

this.labelControl2.Invalidate();

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

Parent.Controls[0].Controls[0].Controls[0].Controls.SetChildIndex(labelControl2, 0);
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.
Attached Image: wpftabcontrol2.JPG


#2 still1

    Neowinian UNSTOPPABLE

  • 6,011 posts
  • Joined: 30-September 09
  • Location: United States

Posted 04 February 2012 - 19:55

Bump anyone?

#3 mute~

    ♫ d(-_-)b ♫

  • 3,202 posts
  • Joined: 28-July 08
  • Location: SandBox

Posted 05 February 2012 - 18:53

Build a custom tabbed control; inherit everything from it's base and just have the label functionality added in by yourself.

#4 Nas

    Neowinian²

  • 222 posts
  • Joined: 12-November 04

Posted 05 February 2012 - 19:09

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.

#5 garethevans1986

    Resident Elite

  • 1,420 posts
  • Joined: 01-April 04
  • Location: Gogledd Cymru / North Wales

Posted 07 February 2012 - 12:33

Could you confirm whether thats WPF or WinForms.

Thanks
GE

#6 still1

    Neowinian UNSTOPPABLE

  • 6,011 posts
  • Joined: 30-September 09
  • Location: United States

Posted 07 February 2012 - 15:27

View Postgarethevans1986, on 07 February 2012 - 12:33, said:

Could you confirm whether thats WPF or WinForms.

Thanks
GE

Its winform build with devxpress controls.

View PostNas, on 05 February 2012 - 19:09, said:

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.

#7 mute~

    ♫ d(-_-)b ♫

  • 3,202 posts
  • Joined: 28-July 08
  • Location: SandBox

Posted 08 February 2012 - 12:33

[Solved]
Create label elsewhere on the form; during the form_load event adjust the 'Top' and 'Left' properties to move the label into correct position - see attached.

Attached Thumbnails

  • Attached Image: easy.png
  • Attached Image: easy.png