[Gambas-user] DatePicker, Forms, Passing Data

Benoit Minisini gambas at ...1...
Tue Mar 29 14:38:15 CEST 2005


On Thursday 24 March 2005 22:14, Jim Ward wrote:
> I'm not sure this is the place I should really be asking this
> question. I'm still trying to learn all this object stuff and am not
> sure how to retrieve my data from the DatePicker, which is on it's on
> form to resemble a popup window, and bring the value back to the main
> form. Of course, I'll also have to decide if the user also picked ok
> or cancel, but that's another story entirely. Can any one help me.
> Thanks in advance.
>
> Regards,
> Jim

Ha! This is one of the common beginner's problems :-)

My solution is using a public variable in the form that includes the 
DatePicker. This variable hust holds the date selected by the user.

To know if the user pressed OK or Cancel, ME.Close() can take an integer value 
that is returned by ShowModal(). For example, you can do ME.Close(TRUE) for 
OK and Me.Close(FALSE) (or Me.Close alone, this is the default) for CANCEL. 
Don't forget that if the user closes the form by closing the window, 
ShowModal() will return 0 too.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list