Dynamically Adding ToolBar, and Buttons on MDI Child Window.

B

Byron Hopp

Anybody have code to add a ToolBar, and its buttons to a MDI Child window.
I have added the Toolbar, and added the buttons, but how do you determine
what the button is going to execute upon the user clicking it. How do you
add this code dynamically?

Byron...
 
C

Cor Ligthert

Byron,

I don't see what in this the MDI child is important.

I do the toolbar by setting a value in the tag field and set a select case
for the toolbar event than.

\\\
Toolbar event
Select case e.button.Tag
case mybutton1
case mybutton2
End Select
///

I hope this helps?

Cor
 
B

Byron Hopp

I didn't express myself correctly, I am currently trying to figure out how
to actuall add the ToolBar, Buttons, and the code to handle the clicks.

Like ...
oWndMdi = NewMdi()
oToolBar = BuildBar()
oWndMdi.Controls.Add(oToolBar)

I am attemption to create some reusable code where I create the MDB Shell in
the visual editor, but the child dialogs are created during runtime and can
vary depending on the requirements. In another language I use the function
to be executed by the button is saved in a codeblock variable which is a
part of the button object, so dynamically adding buttons is easy, how do you
build this code to handle the button clicks where you may be createing
several Mdi Child windows, each of which will need their own button click
handler.

Byron...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top