[Gambas-user] webform questions.
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.Enabled or any individual WebContainer
>> > 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.
> 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.Enabled = Not WebTabPanel1.Enabled
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.Enabled
WebTabPanel1.Enabled = bEnable
If WebTabPanel1.Index = 1 And If Not bEnable Then WebTabPanel1.Index = 0
Note, you can set index to a hidden tab and it will show it's contents so
avoid doing that.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User