Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Putting text in a string var in a newly created form before showing it ?
#1
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
Reply


Messages In This Thread
Putting text in a string var in a newly created form before showing it ? - by SorenJensen - 03-04-2020, 06:13 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)