BUG: TAnchors

edited 9:26AM 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 9:26AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.