Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I create handler for toolbar and menu items in Studio.net

Posted on 2003-12-10
7
Medium Priority
?
225 Views
Last Modified: 2013-11-20
Hello, I'm moving from C++ 6.0 to .net. I created a custom toolbar and want to create handlers for each item. When I select the toolbar in resource view and select the iocn. My property page doesn't show a message or event button. Show how do I add a handler?
0
Comment
Question by:BlackRussian
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 9910550
The Properties window has small icons in it's top part: Properties, Events etc. Click Events (or Messages - I don't remember exactly) and add the handler.
The handlers are added not to toolbar itself, they are added to other windows to which it belongs - like CMainFrame, view etc.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9910555
And don't waste your points clicking twice on the Submit button :-)
You can delete the duplicate question while it hasn't comments.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 9910880
When the .net came out I gave it a try (didn't like some things so I am still with VC 6).  One thing I didn't like was that one seems to be what could be here.
If you do not have a menu then the wizard doesn't seem to be able to hook a (toolbar) button up to an event.  Solution.  Create a menu with the same ID as that of your button and hook the menu event with the wizard.  (The menu doesn't have to be visible in your app - it's just there for the wizard to automate tasks for you).
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9910956
Yes, Wizard support in VC++ 6 is better than in .NET. The only function available in .NET is adding message handlers and member variables. User should make more things manually.
BlackRussian, Andy's idea is good. You can see also how command message handler is added in the text of the program and do the same manually.

By the way, Black Russian - this is from "Naked Gun"?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question