Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an MFC edit box and I have a button.
For the edit box I have a method for ON_EN_KILLFOCUS, and for the button I have method for ON_COMMAND_RANGE.

If the focus is on the edit box, and then I click the button, both methods should be called. But first button's ON_COMMAND_RANGE is called, and meanwhile it stops and ON_EN_KILLFOCUS of the edit box start.

That couse some problems in my project. I want first ON_EN_KILLFOCUS to be called, finished, and only then i want ON_COMMAND_RANGE to be called.

Is there a way for doing it?

Thanks
Posted

1 solution

You could try to derive your own CYourEdit : public CEdit box class,
its own reaction CYourEdit::OnKillFocus(CWnd* pcNewReceiver) by its message entry ON_WM_KILLFOCUS() and then -

subclass the dialog control by your object... :)

/*The framework calls this member function immediately before losing the input focus*/
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900