
Newbie : Adding Menu Bar and Tool Bar to Dialog Based App
With menu bars, you just open your dialog in the dialog editor, right click
on it and go to properties. Then, assuming you already have made your menu
in the resource (by going to your resources tab, right clicking on your
program name that appears in bold, and picking Insert--then choose Menu and
pick New), you should see Menu in the lower right corner and your menu
should be one of the choices in the drop-down box. Then it's attached. To
use buttons with it, the easiest way is to double-click on your menu so it
shows up in the editor and then go to ClassWizard. It should ask you if you
want to use and existing class or a new one. Choose an existing class and
pick the one that says <your program>Dlg (ie, MyProgDlg). Then you should
see all of the ID's of your menu in the Message Maps where you can add
functions and stuff.
As for a toolbar--that one is tricky. The best code I've found is at
www.codeguru.com under dialog--something like "Toolbars and status bars in a
dialog" or something. I've tried looking at the sample Microsoft gives, but
this is way less complicated because it has the code right there for ya.
Just make sure that if you decide to take the code and paste it that you, in
your message maps (if you don't know what I mean, you will), put the two
lines AFTER the commented AFX thing, because if you don't, ClassWizard won't
know where your functions are. I hope this helps. If you need
clarification on this or if I said it too strange and you don't get it, then
just email me and I'll explain more.
Hope this helps,
Quote:
>Hello,
>Novice seeking help. I would like to add a menu bar and a tool bar to
>a dialog based application. I have trawled through the help and
>scowered ( as best I cold ) the microsoft web pages for clues as to
>how to do it. Unfortunately because I am a newbie, I may well have
>been looking in the correct places but because a lot of the
>terminology is still very new ( and unknown ) to me I may not have
>appreciated what I was lookuing at.
>If anyone is able to point me in the right direction ( often just
>starting is the most difficult part ) I would be very grateful. ( Code
>samples would be a dream if anyone has the time - or a pointer to
>where I might find suitable code samples ).
>Kind regards,
>Paul Ainscough