Link to home
Start Free TrialLog in
Avatar of zgeorge_2
zgeorge_2

asked on

combining 2 applications together

hi
application that generates buttons by itself and a application that

works a liitle bit diffrent but based on thesame thing but it doesn't generate buttons


thank you

more points will be aval....
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shaneholmes
shaneholmes

George,

 You can see from the POS application I wrote for you, how to create an application which generates buttons at runtime.

1.) Declare a Object variable of type TButton

var
 MyButton: TButton

2.) You create a Button, on the owner

 MyButton:= TButton.Create(Panel1);

3.) set the objects parent

 MyButton.Parent:= Panel1;

4.) Set its position and size properties

 MyButton.Left:= 10;
 MyButton.Top:= 10;

 MyButton.Width:= 100;
 MyButton.Height:= 50;

5.) Set any other properties

 MyButton.Caption:= 'Click Me';

6.) Assign it an OnClick event

  MyButton.OnClick:= MyClick;


procedure TForm1.OnCLick(Sender: TObject);
begin
 ShowMessage('You clicked me!');
end;


Shane