Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Runtime panel creation
Wed, Jan 25 2012 7:48 PMPermanent Link

Robert Devine

Hi Tim

I tried a simple runtime creation of a panel, but nothing shows:

procedure TForm1.Button3Click(Sender: TObject);
begin
  FTestPanel := TPanel.Create(self);
  FTestPanel.Visible := true;
  FTestPanel.EnableDrag := true;
  FTestPanel.Caption := 'TestPanel';
  FTestPanel.ShowBorder := true;
  FTestPanel.ShowCaption := true;
  FTestPanel.Show;
end;

Is this a bug or am I missing something?

Cheers, Bob
Wed, Jan 25 2012 8:14 PMPermanent Link

Raul

Team Elevate Team Elevate

Bob,

Set the size as well :
 FTestPanel.Top := 100;
 FTestPanel.left := 100;
 FTestPanel.Width := 100;
 FTestPanel.Height := 100;

and it should show up (without need to call Show)

Raul
Wed, Jan 25 2012 8:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Raul,

<< Set the size as well : >>

Hmm, interesting question - should the size default to some value, or is the
current situation reasonable ?

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jan 25 2012 11:25 PMPermanent Link

Raul

Team Elevate Team Elevate

Tim,

<< Hmm, interesting question - should the size default to some value, or is the
current situation reasonable ?>>

My vote would be to have controls with a default non zero height and width size at 0,0

Otherwise i can see this being reported a bug/issue all the time once we start creating them run-time

Raul
Wed, Jan 25 2012 11:36 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Raul,

<< My vote would be to have controls with a default non zero height and
width size at 0,0

Otherwise i can see this being reported a bug/issue all the time once we
start creating them run-time >>

Yep, that's what I was thinking also, and it's what Delphi does.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Jan 26 2012 3:41 AMPermanent Link

Robert Devine

Thanks Raul - unbelievable, I think I set just about every other
property apart from those! I think you're right - without default values
it'll be reported as a bug again.

Cheers, Bob



On 26/01/2012 01:14, Raul wrote:
> Bob,
>
> Set the size as well :
>    FTestPanel.Top := 100;
>    FTestPanel.left := 100;
>    FTestPanel.Width := 100;
>    FTestPanel.Height := 100;
>
> and it should show up (without need to call Show)
>
> Raul
>
Image