[Gambas-user] pass parameters to another form invoke where?

PICCORO McKAY Lenz mckaygerhard at ...626...
Mon Aug 12 17:10:17 CEST 2013


Thanka Tobias and Fabien, theres what i think about two solutions:


1) The proposed from tobias are not beatifull but easy to understand and
good hack ..

From: Tobias Boege <taboege at ...626...>

> In FAuth you can write:
>
> Public Sub MyShowModal(theParameter As ...)
>   ' Do something with theParameter
>   Me.ShowModal()
> End
>
> Then you would do in FMain:
>
> hAuth = New FAuth
> hAuth.MyShowModal(...)
>
> instead of using hAuth.ShowModal() directly.
>
>

2) But i prefer the proposed from Fabien, very elegant... Thanks

From: Fabien Bodard <gambas.fr at ...626...>

> Well Tobi I think you need to complete the idea.
>
>
> in fAuth :
>
> Private $iId as Integer
> Public Value as Integer
> Public sub Run(Id as integer) as boolean
>   dim hForm as new hAuth
>   $iId = Id
> return not   hForm.ShowModal()
>
> End
>
> Public sub _Load()
>
> 'Get UserInfo from $iId and then
> txtUser.Text = resultuser
>
> End
>
>
> Public sub btnValidate_Click()
>
>   return
>
> end
>
> Public Sub bntCancel_Click()
>
>
>   return true
>
> endif
>
> 'in the main form
>
>
> if not hAuth.Run(user.id) then print hAuth.Value
>
>
>



More information about the User mailing list