How to let buttons work on PropertyPage?

Posted on 2003-03-27
Medium Priority
Last Modified: 2013-11-20
I have a propertyPage and I put a "Button" on it and I also implement
function: OnButton(), when I click this button, it should
popup another dialog, but there is nothing happens when it is clicked.
When I put the MessageBox at first line of this function, when I click
the "Button", still there is no any reaction, how to get command message
when you click button on propertyPage? Urgent!!

Question by:Hanqian
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 8228407
If you are using MFC then you can do this.. Delete what you have then go to the class wizard.
Select the class that has the button.
Go to Message Maps tab.
In Object ID's select the button ID.
Click on the message you wand to add.
Click on the Add Function Button.

That will do it.

If you arent using MFC, or you want to hand add the handlers do this.

in the .h of the class that has the button add this to the protected section.

afx_msg void OnMyFunction();

then in the .c/.cpp




Expert Comment

ID: 8228414
In the property Page the BEGIN_MESSAGE_MAP will have CPropertyPage of course.  The code works the same.

Expert Comment

ID: 8414046
Dear expert(s),

A request has been made to close this Q in CS:

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.


Community Support Moderator
Experts Exchange

Accepted Solution

modulo earned 0 total points
ID: 8436804
Saving this Q as a PAQ and refunding the 125 points to the questionner


Community Support Moderator
Experts Exchange

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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