This is a migrated thread and some comments may be shown as answers.

form right-to-left

9 Answers 311 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
nima
Top achievements
Rank 1
nima asked on 12 Jul 2016, 02:40 PM
Hello
How can right-to-left to form his form in this way?

9 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 13 Jul 2016, 08:25 AM
Hi Nima,

The following snippet shows how you can set the text alignment:
this.FormElement.TitleBar.TitlePrimitive.Alignment = ContentAlignment.MiddleRight;

Let me know if I can assist you further.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
nima
Top achievements
Rank 1
answered on 13 Jul 2016, 06:22 PM

This code did not affect alignment.

How could the form right to left, but in this case I have shown in the image

0
Dimitar
Telerik team
answered on 14 Jul 2016, 07:41 AM
Hello Nima,

Thank you for writing back.

With the code from my previous post, the form looks like in your image. So I am a bit confused about what is the exact desired look. Could you please elaborate?

In addition, the following article shows how you can enable the right to left-to-right layout:  Right-To-Left Support.

I am looking forward to your reply.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
nima
Top achievements
Rank 1
answered on 14 Jul 2016, 06:21 PM

I want to be the property of form right to left,But buttons close, maximize, minimize form left to right are.

How to make buttons close, maximize, minimize, or change the form of property right and right to left unchanged?

0
Dimitar
Telerik team
answered on 15 Jul 2016, 08:06 AM
Hello Nima,

You can set the RightToLeft property of the buttons panel only:
this.FormElement.TitleBar.SystemButtons.RightToLeft = true;

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
nima
Top achievements
Rank 1
answered on 15 Jul 2016, 12:29 PM

Thank written code.

Just another problem that,caption form must be right

I have used these codes:

this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;

this.FormElement.TitleBar.RightToLeft = false;

0
Dimitar
Telerik team
answered on 18 Jul 2016, 08:55 AM
Hi Nima,

Thank you for writing back.

You can use the code from my first post. I have recorded a small video to show you how this works on my side. Please note that I still do not understand what is the layout you want to achieve, so if you need further assistance please provide a detailed description of your requirement.

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
nima
Top achievements
Rank 1
answered on 18 Jul 2016, 02:24 PM

This code has no effect on my form :

this.FormElement.TitleBar.TitlePrimitive.Alignment = ContentAlignment.MiddleRight;

I am running version of RadControls for WinForms Q1 2012

Is it possible in this version of the code not work?

0
Dimitar
Telerik team
answered on 19 Jul 2016, 10:23 AM
Hello Nima,

Thank you for writing back.

With this version, you can set the position by dynamically adjusting the Margin of the title. For example, you can use the SizeChanged event:
private void RadForm1_SizeChanged(object sender, EventArgs e)
{
    var buttonsWidht = this.FormElement.TitleBar.SystemButtons.Size.Width;
    var width = this.FormElement.TitleBar.Size.Width;
    var titleWidth = TextRenderer.MeasureText(this.Text, this.Font).Width + this.FormElement.TitleBar.IconPrimitive.Size.Width +15;
    this.FormElement.TitleBar.TitlePrimitive.Margin = new Padding(width - (buttonsWidht + titleWidth), 0, 0, 0);
}

I hope this helps.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Themes and Visual Style Builder
Asked by
nima
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
nima
Top achievements
Rank 1
Share this question
or