Hi Reza
try this in init :
#Define GWL_EXSTYLE -20
#Define WS_EX_LAYOUTRTL 0x400000
#Define WS_EX_NOINHERITLAYOUT 0x100000
Declare Integer GetWindowLong In user32 INTEGER HWnd, Integer nIndex
Declare Integer SetWindowLong In user32 INTEGER HWnd, Integer nIndex, Integer dwNewLong
OldLong = GetWindowLong(Thisform.HWnd, GWL_EXSTYLE)
SetWindowLong(This.HWnd,GWL_EXSTYLE,Bitor(OldLong,WS_EX_LAYOUTRTL,WS_EX_NOINHERITLAYOUT))
>Dear all,
>How to change writing direction to right-to-left programmatically in RichTextBox?
>Manually if I press Ctrl+ right Shift ,the direction will be changed but how to automate it?
>I think i must to use from SendMessage as below, but i have not key code for Ctrl+ right Shift and Ctrl + left Shift.
>
>#DEFINE WM_USER 0x400
>#DEFINE WM_COPY 0x301
>#DEFINE WM_CUT 0x300
>#DEFINE WM_PASTE 0x302
>#DEFINE WM_UNDO 0xc6
>#DEFINE WM_REDO (WM_USER+85)
>
>DECLARE SendMessage IN user32 ;
>INTEGER hWnd,;
>INTEGER wMsg,;
>INTEGER wParam,;
>INTEGER lParam
>
>SendMessage(THISFORM.oleRtf2.OBJECT.Hwnd,WM_PASTE,0,0)
>
>best regards
Ali Mohammad Hossein Zadeh