Reputation:
I have a user control that contains multiple controls (CheckBox, Button, Label...). I want to change the layout of this user control to support right to left languages but i can't find how to do it.
Currently i can change the controls alignement using the RightToLeft
property. But how can i change their positions?
Thank you for your time.
Upvotes: 1
Views: 2765
Reputation:
Thank you guys for your answers but there is a better way to do it.
First we go to the user control properties and select the language property.
After changing it to another language a new resource file will be created for the user control.
After that, using the designer we can change the controls positions in the user control as we like.
The new values will be saved in the created resource file.
When the language has changed, the corresponding resource file will be loaded and the positions will be changed.
If the language is a right to left one, don't forget to specify the right to left property for the controls.
Hope this helps.
Upvotes: 3
Reputation:
Use the layout controls with the RightToLeft property and follow the following links for implementation:
RightToLeft property in Form in C#
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(vs.80).aspx:
Developing Arabic applications should be easy!
Implementing Mirror-Aware Controls for Windows Application with Visual Studio .NET
Upvotes: 2
Reputation: 842
User control mirroring is not supported for user controls, see this connect article: http://connect.microsoft.com/VisualStudio/feedback/details/121202/usercontrol-mirroring-is-not-inherited-from-the-form
Their suggested workaround is to use a table layout panel which will mirror the controls in right to left.
Upvotes: 0
Reputation: 11820
Try to use FlowLayoutPanel
or TableLayoutPanel
to hold your controls and change panels RightToLeft
property
Upvotes: 0