How do you instantiate a Toolbar in code?

I take it back… I had to reference the Toolbar within the Container and I had to ensure that it’s scope was public… but this worked and did exactly what I was trying to do. Thank you! :slight_smile:

Sub Action() Handles Action
  CC1.Toolbar11.SaveButton.Enabled = True
End Sub

[quote=440901:@Markus Winter]Expectations lead to disappointment. Disappointment leads to anger. Anger leads you to the Dark Side …

;)[/quote]
The Dark Side leads you to Tattoine

This demonstrates that with some creativity, many things considered impossible are in fact doable. That is what I call flexible thinking. Or creative, if you will.

There is no perfect tool, that explains the profusion of languages. Xojo may not be perfect, yet it is good enough to have permitted a lot of people to be successful. Including myself.

About how to interact with the toolbar embedded in the Container Control, you need to make it available from outside of the container control. You can add a property myToolbar as toolbar to the CC, and set it to the toolbar.

You can also add toolbar events to the ContainerControl. See RaiseEvent — Xojo documentation

Or add event handlers to your toolbar in code. See http://documentation.xojo.com/api/code_execution/addhandler.html

A good deal of your frustration also comes from your relative lack knowledge of the tool. The more you use it, the more you discover.

Another little detail, which has nothing to do with the piece of software : this forum is one of the few where you will not be looked down as a newcomer, but rather, members will do their best to help you get what you want to achieve (as I did).

IMHO, priceless.

[quote=440897:@Michel Bujardet]Kristin, no offense, but you seem to be mentally pretty rigid about what you expect Xojo to be.

Since I started back in 1982, I programmed in several languages, and each of them have limitations.

Right now, I use another language than Xojo to develop an Android app. There are limitations to it, but instead of blaming the conception, I use imagination and try to make due.

About imagination, precisely, just run the attached project. It should satisfy what you were after. On Mac, it adds a toolbar dynamically very nicely.

DynamicToolbar.xojo_binary_project[/quote]

thanks for the sample project, Michel

ion my project, i used to include the toolbar on each for that i want to toolbar.

now i just called the code to create the dynamic toolbar only when needed.

So much more effecient!!!