03-04-2020, 06:13 AM
(This post was last modified: 03-04-2020, 06:14 AM by SorenJensen.)
Hi all,
This might just be a trivial question I should know the answer to , but I do not seem to find the right way of doing it.
I want to create a new form when pressing a button (in the OnClick), move values from the creating form, onto the created form, before showing it.
So what I would do is:
TIWForm1.Button1.OnClick(sender....
begin
TIWForm2.create(self);
TIWForm2.value1 := 'test';
TIWForrm2.Show
end;
In Iwform2 I have vaue1 defined as a string in the public section of the form. IDE accepts the code, but compiler rejects with
TIWForm2.value1 := 'test'; Error: Method identifier expected... ".value1" should be a method and
TIWForm2.Show; Error: this form of method call only allowed for class methods or constructor.
Is this not possible in IW or what Am I doing wrong ?
Regards
Soren
This might just be a trivial question I should know the answer to , but I do not seem to find the right way of doing it.
I want to create a new form when pressing a button (in the OnClick), move values from the creating form, onto the created form, before showing it.
So what I would do is:
TIWForm1.Button1.OnClick(sender....
begin
TIWForm2.create(self);
TIWForm2.value1 := 'test';
TIWForrm2.Show
end;
In Iwform2 I have vaue1 defined as a string in the public section of the form. IDE accepts the code, but compiler rejects with
TIWForm2.value1 := 'test'; Error: Method identifier expected... ".value1" should be a method and
TIWForm2.Show; Error: this form of method call only allowed for class methods or constructor.
Is this not possible in IW or what Am I doing wrong ?
Regards
Soren