Web 2.0 WebToolbarButton alignment

This is a basic question, trying to see how Web 2.0 works. I want to align a WebToolbarButton to the rightmost on a WebToolbar.

var cmdLogOut As New WebToolbarButton
cmdLogOut.Style = WebToolbarButton.ButtonStyles.PushButton
cmdLogOut.Caption = "Log out"
cmdLogOut.Icon = webpicture.BootstrapIcon("door-open-fill")
me.AddItem(cmdLogOut)

How might I du that?

I have tried like this:

cmdLogOut.Position = WebToolbarButton.Positions.Right

As the docs suggests: https://docs.xojo.com/WebToolbarButton.Position

But I get this error:

MainView.MainViewToolbar.Opening, line 5
This item does not exist
cmdLogOut.Position = WebToolbarButton.Positions.Right

You could add a flex space before the button.

Var flexspace As New WebToolbarButton
flexspace.Style = WebToolbarButton.ButtonStyles.FlexibleSpace
Me.AddItem(flexspace)

5 Likes

Thank you!

1 Like

And generally speaking: don’t forget to double check your results on mobile (changing the size of your browser will give you an indication, but it might still look different on a real mobile device or the simulator), or just ignore mobile completely (that’s of course always an option :wink: ).

2 Likes