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

Martin McGlensey mmcg29440 at ...3163...
Tue Nov 18 20:42:47 CET 2014


Hello,

 

I have created a dialog form. As created by Gambas, it has an OK and Cancel
button. I want to return three properties or an array from the form. One
each for the three textboxes on the form.

I added a textbox to the form to test it. Call it Textbox1. Used the code
below to add a property called "Login" to the Dialog:

 

Property Login As String

Private strLogin AS String

 

Private Function Login_Read()

                Return txtTextbox1.Text

Return

 

Private Sub Login_Write(Value as String) as String

                strLogin = Value

End

 

I call the Dialog from the main form by frmDialog.ShowModal. When I load the
frmDialog, enter the text in the textbox and click OK. The Dialog closes but
no value is returned to the main form.

If I explicitly set Login_Read to Return "XYZ" it works  properly. It
returns "XYZ" to the main form. If I try to get the contents of
Textbox1.Text it returns an empty string. There has got to be a way of
returning the value of a textbox as a property of a dialog form.  I'd rather
not use public variables on the main form as there are too many variables
already.

 

Would you guys please point me in the right direction.

 

Thanks,

Marty

 

 




More information about the User mailing list