[Gambas-user] webform questions.
Bruce Steers
bsteers4 at gmail.com
Mon Nov 7 22:33:03 CET 2022
On Mon, 7 Nov 2022 at 20:53, Bruce Steers <bsteers4 at gmail.com> wrote:
>
>
> On Mon, 7 Nov 2022 at 19:36, Benoit Minisini <
> benoit.minisini at gambas-basic.org> wrote:
>
>> Le 07/11/2022 à 20:30, Bruce Steers a écrit :
>> >
>> > what about just adding a simple _get() to it Ben?
>> >
>> > Public Function _get(Index As Integer) As WebContainer
>> >
>> > Return $aTab[Index]
>> >
>> > End
>> >
>> > Then could use WebTabPanel[0].Enabled or any individual WebContainer
>> you
>> > wanted.
>> >
>> > Or would you prefer a hidden _WebTabPanelContainer.class to only permit
>> > certain actions?
>> > (i've done that too, has Enabled and Text only)
>> >
>> > Respects
>> > BruceS
>> >
>>
>> It's more complex than just accessing the underlying containers, if we
>> want to hide tabs.
>>
>> Regards,
>>
>
> Yes i was thinking about the "hide" that did not seem so simple.
> at least being able to access the containers we can disable/enable and
> add/remove contents (plus other options)
>
> Are we likely to break things accessing the underlying containers?
>
> I can hide tabs by setting the Enabled property and modifying the
> _Render() event
> (i tried with the .Visible property but it failed)
>
> So find attached here Marco a WebTabPanel2.class that will hide tabs by
> setting their enabled property (sadly not Visible property)
> Do something like this to toggle hidden state..
>
> WebTabPanel1[1].Enabled = Not WebTabPanel1[1].Enabled
> WebTabPanel1.Refresh
>
Dang, Almost perfect, sorry,
that glitches if you are on tab 2 and remove tab 2 the contents do not
refresh, so fix by changing the index
Public Sub HideTab2() ' toggle Tab2 (indexed at 1)
Dim bEnable As Boolean = Not WebTabPanel1[1].Enabled
WebTabPanel1[1].Enabled = bEnable
If WebTabPanel1.Index = 1 And If Not bEnable Then WebTabPanel1.Index = 0
WebTabPanel1.Refresh
End
Note, you can set index to a hidden tab and it will show it's contents so
avoid doing that.
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221107/c4444a0c/attachment.htm>
More information about the User
mailing list