Hanqian
asked on
How to let buttons work on PropertyPage?
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.
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.
In the property Page the BEGIN_MESSAGE_MAP will have CPropertyPage of course. The code works the same.
Dear expert(s),
A request has been made to close this Q in CS:
https://www.experts-exchange.com/questions/20598694/Delete-a-question.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
A request has been made to close this Q in CS:
https://www.experts-exchange.com/questions/20598694/Delete-a-question.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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ON_BN_CLICKED(IDOFYOURBUTT
END_MESSAGE_MAP()