Creating a MobileToolbar Button

Trying to grok all the new changes. On a MobileScreen, in the Opening event handler, when I do this:

Var button As MobileToolbarButton
button = MobileToolbarButton(MobileToolbarButton.Types.Add)

I’m getting a type mismatch error when I attempt to create the button saying it’s an enum and not a MobileToolbarButton even though my code matches what’s on the Constructor page in the docs:

http://documentation.xojo.com/api/user_interface/mobile/mobiletoolbar.htmlButton.Constructor(buttonType_As_MobileToolbarButton.Types,buttonCaption_As_String%3D_%22%22,buttonIcon_As_Picture%3D_Nil)

Suggestions?

To call a Constructor, you would write it like this:

Var button As New MobileToolbarButton(MobileToolbarButton.Types.Add)
Toolbar.AddButton(button)

Thanks, Paul. I was reusing “button” several times to create 3 buttons on the toolbar. This worked fine with iOSToolButton. Interestingly, for the 3rd button I got no error doing this:

button = MobileToolbarButton(Picture.SystemImage(“plus.square.on.square”,0,Picture.SystemImageWeights.Unspecified,Nil,Nil))

In fact, I get an error message if I do it like you suggested for the “Type” buttons.