Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have used this TabControl to create the following tablayout in a winform application

enter image description here

How do i make the tabs appear right to left?
I mean make it like this image

enter image description here

I also tried to Use RightToLeftLayout property but this tab control doesn't have that property

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
145 views
Welcome To Ask or Share your Answers For Others

1 Answer

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):

enter image description here

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.

enter image description here

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:

enter image description here

This is the form with RightToLeft set to yes, and RightToLeftLayout set to disabled:

enter image description here

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...