Solved

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

Posted on 2003-12-10
7
216 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 250 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 44

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 68
Macro to save highlighted rows as a separate file 5 41
countEvens challenge 2 74
java ^ examples 8 62
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 …
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

919 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now