You can use the MS RightToLeft Property to achieve this as at
MainMenu.RightToLeft Property[
^]
You can use this when your form loads, which will change the text alignment from the Arabic side to the English side when your form loads -
private void Myform_Load(object sender, EventArgs e)
{
this.RightToLeft = RightToLeft.No;
MytextBox.TextAlign = HorizontalAlignment.Left;
}
If you want to manually trigger the change from Arabic to English side, you can create a method to handle it and call that method when needed -
private void ArabicToEnglishAlignment()
{
MyForm.RightToLeft = RightToLeft.No;
MytextBox.TextAlign = HorizontalAlignment.Left;
}
private void MyOtherMethod()
{
ArabicToEnglishAlignment();
}
Combining the code, you can use -
using System;
using System.Windows.Forms;
namespace TextAlignmentExample
{
public partial class MyForm : Form
{
public MyForm()
{
InitializeComponent();
}
private void MyForm_Load(object sender, EventArgs e)
{
this.RightToLeft = RightToLeft.No;
MytextBox.TextAlign = HorizontalAlignment.Left;
}
private void ArabicToEnglishAlignment()
{
this.RightToLeft = RightToLeft.No;
MytextBox.TextAlign = HorizontalAlignment.Left;
}
private void SomeOtherMethod()
{
ArabicToEnglishAlignment();
}
}
}