Mega Code Archive

 
Categories / Delphi / Ide Indy
 

How to correct a BiDi bug in Delphi

Title: How to correct a BiDi bug in Delphi const WS_EX_LAYOUTRTL = $00400000; WS_EX_LAYOUT_RTL = WS_EX_LAYOUTRTL; {...} TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } procedure CreateParams(var Params : TCreateParams); override; end; {...} implementation procedure TForm1.CreateParams(var Params : TCreateParams); begin inherited CreateParams(Params); Params.ExStyle := WS_EX_LEFT or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_LAYOUT_RTL; {WS_EX_LEFT to set the text caption to the right, use WS_EX_RIGHT to set the caption to the left} end; procedure TForm1.FormCreate(Sender: TObject); begin BiDiMode := bdLeftToRight; //A must !!! end;