PRIVATE hNew AS Fsecond'if the second parameter is true, the new window should be modal
STATIC PUBLIC SUB Main()
DIM hForm AS Form
hForm = NEW Fmain
hForm.show
END
PUBLIC SUB Button1_Click()
ShowSecond("modal, " & TextBox1.Text, TRUE)'here the constructor of the class Fsecond is used
END
PUBLIC SUB Button2_Click()
ShowSecond("modeless, " & TextBox1.Text, FALSE)
END
PRIVATE SUB ShowSecond(strVal AS String, bmode AS Boolean)
IF bmode THEN
hNew = NEW Fsecond(strVAl)'here a method of Fsecond is used to receive the
hNew.ShowModal
ELSE
hNew = NEW Fsecond
hNew.UpdateField(strVal)
hNew.Show
ENDIF
END
'the parameter has to be optional,
'otherwise it would be impossible to
'initialize an instance of this class
'without a parameter
PUBLIC SUB _new(OPTIONAL X AS String)
UpdateField(X)
END
PUBLIC SUB UpdateField(wort AS String)
TextLabel1.Text=wort
END