BUG: TAnchors

edited 12:45AM in FastScript
Hi,

if I put a Panel on a Form and a Button on the right site of this Panel and set Button.Anchors := akRight, then the Button is not visible at the runtime. If the Button is set directly on the form it works! What can I do? Here is the Code I use:

var
MyForm: TForm;
MyButton: TButton;
MyPanel: TPanel;
begin
MYform := TForm.Create(nil);
MyPanel := TPanel.Create(nil);
MyPanel.Parent := MyForm;
MyPanel.Align := alClient;
MyButton := TButton.Create(nil);
MyButton.Parent := MYPanel;
MyButton.Top := 10;
MyButton.Left := 200;
MYButton.Anchors := akRight;
MyForm.ShowModal;
MYButton.Free;
MYPanel.Free;
MyForm.Free;
end.

Comments

  • edited 12:45AM
    Dimitri wrote:
    Hi,

    if I put a Panel on a Form and a Button on the right site of this Panel and set Button.Anchors := akRight, then the Button is not visible at the runtime. If the Button is set directly on the form it works! What can I do? Here is the Code I use:

    var
    MyForm: TForm;
    MyButton: TButton;
    MyPanel: TPanel;
    begin
    MYform := TForm.Create(nil);
    MyPanel := TPanel.Create(nil);
    MyPanel.Parent := MyForm;
    MyPanel.Align := alClient;
    MyButton := TButton.Create(nil);
    MyButton.Parent := MYPanel;
    MyButton.Top := 10;
    MyButton.Left := 200;
    MYButton.Anchors := akRight;
    MyForm.ShowModal;
    MYButton.Free;
    MYPanel.Free;
    MyForm.Free;
    end.
    Mam ten sam problem i za cholerę nie wiem jak go rozwiązać, tyle, że w c++.

    [eng]
    I have the same problem and I for shit do not know as to solve him. I try this to make in C ++.
    If you know solution write: cyfrowy_baron@op.pl.
  • edited July 2006
    Mam rozwiązanie, ale w C++, na Delphi musisz sobie sam przetłumaczyć. To będzie jakoś podobnie.

    [~Eng]
    I have solution, but in C ++, you on Delphi have me alone to translate. This will be somehow similarly.

    TAnchors A;
    A.Clear();
    A = A << akRight << akBottom << akTop << akLeft;
    Memo1->Anchors = A;

    Look to my service with times, it is Polish, but source codes are in English language.
    Cyfrowy Baron

Leave a Comment