tags:

views:

136

answers:

2

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
AFAIK, that will place them on the right *edge* of the control...
Shog9
thanks ...got that..
reggie
@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
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
@Cory, it looks like the OP meant what Brandon assumed he meant. :-)
Jason D
@Jason D: That's what it looks like to me but then I have to wonder what "centre" tab alignment would be.
Cory Charlton
+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