Edit box problem
Hi,
I am having a edit box and a function is called when focus is lost.
What is happening if focus is lost because a pop up window suddenly comes up or user tries to open another application an error message is coming which I want to show only when user set focus to someother control within same application only. so how to overcome this ?
thanks
regds
Raghavendra H
# 1 Re: Edit box problem
Can you use punctuation, or make shorter sentences, for I don't understand what happens, and what you really want.
I might not be the only one.
Thanks.
Marina
# 2 Re: Edit box problem
You probably call UpdateData from EN_KILLFOCUS handler.
You have set an edit control to accept certain range of values and verification routime (DDX. . .) invokes message box if validation fails.
Either validate it yourself, or call GetFocus and determine where a focus is set permitting change only if outside window is gaining focus without validation by not calling update data, or calling UpdateData(false) to set previous value.
That actually defeats reason for checking a value so you may consider removing validation.
JohnCz at 2007-11-10 8:57:33 >

# 5 Re: Edit box problem
Originally posted by hraghavendra
Hi Andreas,
you are right. That is exactly what I wanted. Please let me know if there is a way out.
thanks
regds
Raghavendra H
Unfortunately, I do not know of any way. Basically I assume that the bigger problem would be the pop-up window. Clicking on another application might send some message to your application that it is losing focus. I have the same problem but was too lazy until now to really take a look how to solve this. But I would like to know as well...maybe John or anybody else can provide appropriate answers...