Re: [Gambas-user] How do I pass a user parameter from a dialog form?
Brought to you by:
gambas
|
From: Fabien B. <gam...@gm...> - 2014-11-18 21:14:15
|
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 |