[Lazarus] Manually creating a form
zeljko at holobit.net
Fri Jun 29 11:20:35 CEST 2012
On Friday 29 of June 2012 11:16:06 Koenraad Lelong wrote:
> I'm trying to manually create a form and in it's OnCreate event populate
> it with controls. But I'm doing somehing wrong.
> This is my creating sequence :
> Nothing special I think.
> This is a sample of the create-code :
> procedure TForm2.FormCreate(Sender: TObject);
> i : integer;
> upper : integer;
> for i:=0 to 4 do
> But when I run the code, I get a segfault at the location where I modify
> the form's height. If I remove that, I get the form but the edits do not
> When I modify the code to automatically create the form this works. So
> I'm clearly missing something.
> Any tips, links to documentation ?
Do not use variable in OnCreate(). Sender parameter is your form.
So instead of using Form2.Height := , use TCustomForm(Sender).Height or
whatever. That should work.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus