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

i have a text box which is implemented as a window, when double clicked the window makes the text box editable, and I need it to save the changes of the text box, if I click OUTSIDE the textbox( basically the window that contains the text box).

this window containing textbox is implemented as modal window. If I click outside the editable window, it beeps, as if does not want to loose attention, and hence the mouse click event code which I had implemented the window behind it, does not get triggerred.

what to do?

I have been suggested to use a gloabl mouse click event and to capture x,y of the mouse left click and compare it with the boundaries of the textbox window.

how do I implement this global mouse click event?

waiting eagerly for the supportive answers.
Posted
Updated 1-Nov-13 11:57am
v2
Comments
Code-o-mat 1-Nov-13 6:54am    
Does this need to work inside your own application only or do you need this functionality also when the user clicks outside of your application, e.g. onto another application's window or the task bar or whatever?

1 solution

You could call your "save" code when the text box loses focus.

Look up the window message WM_KILLFOCUS
 
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