whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

20 Visitors Online


 
...correct a BiDi bug in Delphi?
Autor: Ido Kanner
[ Print tip ]  

Tip Rating (13):  
     


{
  When you set the BiDiMode in you form to bdRightToLeft, you do only HALF mirroring.

  Since Win98 (Hebrew/Arabic version) mirror it's envirement completly
 (the Minimize, Close, Maxmize buttons are on the Left, and the Icon is on the right).
  How can we do it 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;

{The result is Right to Left (including the buttons, the icon and the system menu) }


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners