السلام عليكم
إليكم هذا الكود الذي يقوم بضبط اتجاه الكتابة باللغة العربية في أداة RichText من اليمين لليسار
Sub SetTxt(rt As RichTextBox, MySt As String) On Error Resume Next Dim MyRtf$ With rt .TextRTF = vbNullString .TextRTF = Replace(Replace(MyRtf, "\ltrch", "\rtlch"), "\ltrpar", "\rtlpar") .Text = MySt MyRtf = .TextRTF .TextRTF = Replace(Replace(MyRtf, "\ltrch", "\rtlch"), "\ltrpar", "\rtlpar") MyRtf = vbNullString .SelStart = 0: .SelLength = Len(MySt) .SelAlignment = 1 .SelStart = 0 .SelLength = 0 End With End Sub
Private Sub Form_Load() SetTxt RichTextBox1, RichTextBox1.Text End Sub
بالتوفيق


