form right-to-left

10 posts, 0 answers
  1. nima
    nima avatar
    5 posts
    Member since:
    Jul 2016

    Posted 12 Jul Link to this post

    Hello
    How can right-to-left to form his form in this way?
  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 13 Jul Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. nima
    nima avatar
    5 posts
    Member since:
    Jul 2016

    Posted 13 Jul Link to this post

    This code did not affect alignment.

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

  5. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 14 Jul Link to this post

    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.
  6. nima
    nima avatar
    5 posts
    Member since:
    Jul 2016

    Posted 14 Jul Link to this post

    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?

  7. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 15 Jul Link to this post

    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.
  8. nima
    nima avatar
    5 posts
    Member since:
    Jul 2016

    Posted 15 Jul Link to this post

    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;

  9. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 18 Jul Link to this post

    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.
  10. nima
    nima avatar
    5 posts
    Member since:
    Jul 2016

    Posted 18 Jul Link to this post

    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?

  11. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 19 Jul Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready