Recent

Author Topic: [Solved] RightToLeft MessageDlg?  (Read 19236 times)

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: [Solved] RightToLeft MessageDlg?
« Reply #30 on: October 20, 2013, 03:57:32 pm »
Are you saying that you set Label1.Anchors:= [] BEFORE calling RtlCtrl and it generated that SAME error?  :)
Why don't you upload your sample project here?

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: [Solved] RightToLeft MessageDlg?
« Reply #31 on: October 20, 2013, 04:08:53 pm »
This should explain it.  Start a new project with a blank Form.

Code: [Select]
uses Windows;

procedure RTLCtrl(ACtrl: TObject);
begin
  if ACtrl is TWinControl then
    with TWinControl(ACtrl) do begin
      SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE)
        or WS_EX_LAYOUTRTL);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  ACombo: TComboBox;
  ALabel: TLabel;
begin
  ACombo:= TComboBox.Create(Self);
  ACombo.Parent:= Self;
  ALabel:= TLabel.Create(Self);
  ALabel.Parent:= Self;
  ALabel.Anchors:= [];
  RtlCtrl(Self);
end;
« Last Edit: October 20, 2013, 04:37:12 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

 

TinyPortal © 2005-2018