Hi forum
In a webapp I create a menu for the user on top right. I add some menuitems with texts. when the user clicks on it, the menu appears. that works fine. but the text of the menuitems displayed alignment left and disappers at the end of the browser window:
// Menu Button
btn = New WebToolbarButton
btn.Style = WebToolbarButton.ButtonStyles.Menu
btn.Caption = "Menu"
btn.Tag = "menu"
btn.Icon = icons8menu64
btn.Menu.AddMenuItem(New WebMenuItem("Mein Profil", "profile"))
btn.menu.AddSeparator
btn.Menu.AddMenuItem(New WebMenuItem("Meine Veranstaltungen", "events"))
Self.AddItem(btn)
How can I change that, for example to alignment right? Or is there a better way?
Thanks
Daniel
AlbertoD
(AlbertoD)
May 8, 2026, 2:45pm
2
What version of Xojo are you using?
Do you change the code in any way (CSS, JavaScript)?
What browser are you using?
I fired up Xojo2026r1.2, loaded WebToolbar example, using Chrome, changed the right menu code to:
// Menu Button
btn = New WebToolbarButton
btn.Style = WebToolbarButton.ButtonStyles.Menu
btn.Caption = "Menu"
btn.Tag = "menu"
btn.Icon = star
btn.Menu.AddMenuItem(New WebMenuItem("Mein Profil", "profile"))
btn.menu.AddSeparator
btn.Menu.AddMenuItem(New WebMenuItem("Meine Veranstaltungen", "events"))
Self.AddItem(btn)
and get this:
not sure what is the difference with your project.
Edit: tested locally in Safari and Firefox, it looks the same as the screenshot above
I’m using Xojo 2024R4 under Linux Mint, Browser is Firefox 150 also under Linux Mint, no CSS or JS. I tested also under Win 11 with Firefox 150 and Edge 147.
Daniel
AlbertoD
(AlbertoD)
May 8, 2026, 2:59pm
4
Daniel Collet:
I’m using Xojo 2024R4
Maybe something was changed/fixed since then. You can test 2026r1.2 if you want.
I don’t have 2024r4 installed to test and look for workarounds. I hope someone else can give you some tips for that version. Sorry.
AlbertoD:
Xojo2026r1.2
I’ve tested now under Xojo2026r1.2 mit Linux Mint and FireFox and here it works.