Setting the WebToolBar.Enabled property to False doesn’t disable the toolbar.
If it’s only actual WebToolBarItem objects which are meant to be disabled, it probably make sense to remove the WebToolBar.Enabled property?
Otherwise WebToolBar.Enabled should block the toolbar from being clicked and change its visual state when it’s set to False.
See case https://tracker.xojo.com/xojoinc/xojo/-/issues/77724
–
Extends method to work around the issue below.
Public Sub enabled_WORKAROUND(extends wtb as WebToolbar, assigns is_enabled as Boolean)
if wtb.LastItemIndex < 0 then Return
for n as integer = 0 to wtb.LastItemIndex
wtb.ItemAt(n).Enabled = is_enabled
next
Return
End Sub
Notes:
-
If you are using this method in a library module shared across multiple project types, you should adjust each methods attributes so they’re only included in Web Projects:
-
This method enables or disables all toolbar items as a proxy for enabling/disabling the entire toolbar. It won’t remember the “state” of individual items’ .Enabled property, so if you need a mix of enabled/disabled buttons, you’ll need to handle this yourself. (and you probably don’t need this method? )
fyi @Ricardo_Cruz