Re:Creating buttons during runtime
Quote
Mike Johnson (Mich...@SOTA.com) wrote:
: Is creating buttons during run time possible? Basically what I am
: trying to do is create an array of button objects on a form. The
: number of buttons will depend upon what type of error, message, note,
: etc. we are going to display to the user. The dialog in question is
: actually a component which is first being created, once created, I am
: attempting to create the buttons to display on the dialog box.
: However, nothing I seem to do makes those &*@$*# buttons to appear.
: Any help would be appreciated. Below is some sample code.
: private
: //... bunch of stuff above here
: TButtons : Array[1..5] of TButton;
: //etc
: //etc...
: FrmDialogComponent := TfrmMZDialog.Create(self);
: TButtons[1] := TButton.Create(FrmDialogComponent);
: with TButtons[1] do begin
<<<<< parent := FrmDialogComponent; >>>>>>>>>>>>>>
: Left := 312;
: Top := 34;
: Caption := '&Next';
: TabOrder := 1;
: Visible := TRUE;
: end; // with ... do begin
Mike,
Add the line higlighted above. If the parent is not set the control will
not be visible, even if visible is set true.
good luck,
--
Ray Hildreth
Greater Columbus Free-Net
rh...@freenet.columbus.oh.us