问题
I have used this TabControl to create the following tablayout in a winform application
How do i make the tabs appear right to left?
I mean make it like this image
I also tried to Use RightToLeftLayout property but this tab control doesn't have that property
回答1:
It seems that MTC while affected by RightToLeft doesn't draw as expected (In part due to the fact that it statically draws the tabs from left to right and calculates width from the left):
It's easy enough to do in WinForms:
The secret is to apply RightToLeft on your form.
In the properties panel for your form ensure the following are set to Yes and True respectively.
Note that RightToLeft is considered an Ambient property, so child controls should inherit from the parent (so long as the child control doesn't have the property set).
You can read more about that here: https://msdn.microsoft.com/en-us/library/system.windows.forms.control.righttoleft(v=vs.110).aspx
You can read more about RightToLeftLayout here (note that this property does NOT get inherited by children):
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(v=vs.110).aspx
This is the form with RightToLeft set to yes & RightToLeftLayout set to true:
This is the form with RightToLeft set to yes, and RightToLeftLayout set to disabled:
I suggest reading the MSDN articles above if you'd like to have more control over the layout.
Edited: Added additional imagery to show the function of the various properties.
来源:https://stackoverflow.com/questions/40047358/how-to-make-managed-tab-control-mtc-appear-right-to-left