How to verify the data when the focus leaves [modified]
-
I am making a custom control that can recieve some datas and verify the datas recieved. The custom control(suppose it is named CDataVerify) is inherited from Cwnd and it contains three CEdit controls.The design is when the focus leaves the CDataVerify, it(CDataVerify) should verify the values of thethree CEdit control. Now the problem comes, when the focus leaves the CDataVerify control,how can the CDataVerify control know the focus lose and should verify the datas? (At first I think the onKillFocus() event maybe resolve the problem. But it can not, for the CDataVerify control never got the focus. When typing something to the contained CEdit control, the focus just belongs to the CEdit control, not the CDataVerify.) Is there any way to let the CDataVerify control verify datas when the focus leaves? ////////////////////////////// -- modified at 21:27 Thursday 25th May, 2006
-
I am making a custom control that can recieve some datas and verify the datas recieved. The custom control(suppose it is named CDataVerify) is inherited from Cwnd and it contains three CEdit controls.The design is when the focus leaves the CDataVerify, it(CDataVerify) should verify the values of thethree CEdit control. Now the problem comes, when the focus leaves the CDataVerify control,how can the CDataVerify control know the focus lose and should verify the datas? (At first I think the onKillFocus() event maybe resolve the problem. But it can not, for the CDataVerify control never got the focus. When typing something to the contained CEdit control, the focus just belongs to the CEdit control, not the CDataVerify.) Is there any way to let the CDataVerify control verify datas when the focus leaves? ////////////////////////////// -- modified at 21:27 Thursday 25th May, 2006
willbin wrote:
(At first I think the onKillFocus() event maybe resolve the problem. But it can not, for the CDataVerify control never got the focus.
But did the edit controls themselves receive the
WM_KILLFOCUS
message?
"The largest fire starts but with the smallest spark." - David Crow
-
willbin wrote:
(At first I think the onKillFocus() event maybe resolve the problem. But it can not, for the CDataVerify control never got the focus.
But did the edit controls themselves receive the
WM_KILLFOCUS
message?
"The largest fire starts but with the smallest spark." - David Crow
Thank you. of course, yes. The edit controls recieve the WM_KILLFOCUS message. But the edit control recieved the WM_KILLFOCUS message only can deal with the data itself held. It do not know the value of its siblings. The Parent knows, but the parent has't the focus(Can not recieve the WM_KILLFOCUS message when the focus leaves.) ////////////////////////////// A stranger , also a challenger
-
Thank you. of course, yes. The edit controls recieve the WM_KILLFOCUS message. But the edit control recieved the WM_KILLFOCUS message only can deal with the data itself held. It do not know the value of its siblings. The Parent knows, but the parent has't the focus(Can not recieve the WM_KILLFOCUS message when the focus leaves.) ////////////////////////////// A stranger , also a challenger
So can you handle WM_KILLFOCUS for the edit controls, and get them to send a message to their parent which triggers the data verification?
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
So can you handle WM_KILLFOCUS for the edit controls, and get them to send a message to their parent which triggers the data verification?
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
Thank you.Notify the parent(CDataVerify) to do data verification in spite of wether or not the focus will be still setted to his parent. Maybe not good enough, but it really resolves problem. Thank Ryan. ////////////////////////////// A stranger, also a challenger
-
Thank you. of course, yes. The edit controls recieve the WM_KILLFOCUS message. But the edit control recieved the WM_KILLFOCUS message only can deal with the data itself held. It do not know the value of its siblings. The Parent knows, but the parent has't the focus(Can not recieve the WM_KILLFOCUS message when the focus leaves.) ////////////////////////////// A stranger , also a challenger
willbin wrote:
But the edit control...do not know the value of its siblings.
Nor should it. Each control should take care of itself.
"The largest fire starts but with the smallest spark." - David Crow