[Gambas-user] Accesing workspace's tabs

Ron ron at ...1740...
Tue Oct 14 23:32:06 CEST 2008


Jorge Carrio'n wrote:
>> Ron_2nd wrote:
>> use  this routine in my app, if a workspace is not already created it
>> will be, if it is, it activates it
>>
>> ' load a page onto the workspace, or give already loaded page focus.
>> PUBLIC SUB OpenPage(hForm AS Form)
>>
>> wrkMain.Add(hForm)
>> wrkMain.ActiveWindow = hForm
>>
>> END
>>
>> Regards,
>> Ron_2nd
>>     
>
> I think than when you Add a workspace it becomes the ActiveWindow by default.
> So if in you function hForm already exists it should duplicate the
> tabstrip. Ins't it?
> Perhaps the right code should be something like this:
>
> PUBLIC SUB OpenPage(hForm AS Form)
>
> TRY wrkMain.Activewindows= hForm
> If error then WrkMain.Add(hForm)
>
> END
>
> Isn't it?
>
> Thanks for your answer.
>
> Jorge
>
>   
Try to add it if it's already there doesn't result in duplicates,
I use it all the time in my prog it works ok this way.

The try and error code looks more clean, but is more code ;-)

regards,
Ron_2nd.





More information about the User mailing list