Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to let buttons work on PropertyPage?

Posted on 2003-03-27
4
Medium Priority
?
208 Views
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!!

Hanqian.
Thanks.
0
Comment
Question by:Hanqian
  • 2
  • 2
4 Comments
 

Expert Comment

by:abelblaine111
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

BEGIN_MESSAGE_MAP(CMyClass, CDialog)
   ON_BN_CLICKED(IDOFYOURBUTTON, OnMyFunction)

END_MESSAGE_MAP()

0
 

Expert Comment

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

Expert Comment

by:modulo
ID: 8414046
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/Q_20598694.html

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.

modulo

Community Support Moderator
Experts Exchange
0
 

Accepted Solution

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

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

581 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