is there any way that i can align the tab control to the right? by default, the tabs are to the left. can i change it to the right or centre.??
+1
A:
For Windows Forms, you can set the TabControls Alignment property to Right using the TabAlignment enum.
TabControl.Alignment = TabAlignment.Right;
Brandon
2009-12-14 18:32:31
AFAIK, that will place them on the right *edge* of the control...
Shog9
2009-12-14 18:34:03
thanks ...got that..
reggie
2009-12-14 18:36:26
@Shog9, I think that is what he wanted. The question says "align the tab control to the right", but the body says "by default, the tabs are to the left". Although I'm not positive...
Brandon
2009-12-14 18:36:37
Not sure why this was accepted unless I misunderstand the OPs question. This will put the buttons on the right edge. It will NOT align the tabs to the right on the top of the control.
Cory Charlton
2009-12-14 18:37:16
@Cory, it looks like the OP meant what Brandon assumed he meant. :-)
Jason D
2009-12-15 01:11:44
@Jason D: That's what it looks like to me but then I have to wonder what "centre" tab alignment would be.
Cory Charlton
2009-12-15 04:46:19
+1
A:
You can use:
tabControl1.RightToLeft = RightToLeft.Yes;
tabControl1.RightToLeftLayout = true;
But it might have other repercussions. This keeps the tab pages at the top of the TabControl but aligns them to the right. You may have to specifically set the RightToLeft values of the TabPage children manually after making this change so they don't inherit the setting.
Cory Charlton
2009-12-14 18:36:18