[Gambas-user] How do I pass a user parameter from a dialog form?

Fabien Bodard gambas.fr at ...626...
Tue Nov 18 22:14:08 CET 2014


the common way is :


In the form :

Static Public Param1 as string
Static Public Param2 as String
Static Public Param3 as string


Public Function Run(hParam1 as string, hParam2 as string, hParam3 as
string) as boolean

dim hForm as FDialog

Return Not Me.ShowDialog()

end

Public Sub Form_Open1
  TextBox1.Text = Param1
  TextBox2.Text = Param2
  TextBox3.Text = Param3

end

Public Sub btnValidate_Click()
  Param1 =TextBox1.Text
  Param2 = TextBox2.Text
  Param3 = TextBox3.Text
  me.Close(True)
End

Public sub btnCancel_Click()

  Me.Close

End


Calling the form :


FDialog.Param1 = "myparam1"
FDialog.Param2 = "MyParam2"
FDialog.Param3 = "MyParam3"

If Not Fdialog.Run() then

Print FDialog.Param1 ,FDialog.Param2 ,FDialog.Param3

endif




More information about the User mailing list