CButton Killfocus
-
How do you get the killfocus for a CButton. There is a ON_BN_KILLFOCUS but that never comes. In the class wizard there is no option for killfocus. scott
Just a guess, but according to the platform SDK, buttons must have the BS_NOTIFY style set if you want them to send BN_KILLFOCUS. Does your button have that style set?
"We are the knights who say Ni" (The Knights Who Say Ni)
-
How do you get the killfocus for a CButton. There is a ON_BN_KILLFOCUS but that never comes. In the class wizard there is no option for killfocus. scott
You probably can't get the KillFocus message because it doesn't propagate up to the button's parent window. So you need to derive your own class from CButton and then you can add a message handler for WM_KILLFOCUS. Regards, Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
-
You probably can't get the KillFocus message because it doesn't propagate up to the button's parent window. So you need to derive your own class from CButton and then you can add a message handler for WM_KILLFOCUS. Regards, Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
WM_KILLFOCUS doesn't propagate up, but the button does send BN_KILLFOCUS to its parent window (if its BS_NOTIFY style is set) - so handling the BN_KILLFOCUS notification in the parent should work.
"We are the knights who say Ni" (The Knights Who Say Ni)
-
WM_KILLFOCUS doesn't propagate up, but the button does send BN_KILLFOCUS to its parent window (if its BS_NOTIFY style is set) - so handling the BN_KILLFOCUS notification in the parent should work.
"We are the knights who say Ni" (The Knights Who Say Ni)
Cool, so he just needs to handle the WM_NOTIFY message on the parent and check for BN_KILLFOCUS along with the proper ID for the button. Thanks for the info. Regards, Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
-
WM_KILLFOCUS doesn't propagate up, but the button does send BN_KILLFOCUS to its parent window (if its BS_NOTIFY style is set) - so handling the BN_KILLFOCUS notification in the parent should work.
"We are the knights who say Ni" (The Knights Who Say Ni)