Solved

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

Posted on 2003-12-10
7
215 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

20 Experts available now in Live!

Get 1:1 Help Now