简体   繁体   English

单击清洁编辑框文本

[英]Clean edit box text on click

I have a form with buttons and edit boxes. 我有一个带按钮和编辑框的表格。 I want to clean the edit boxes on mouse click, which event should I use in LRESULT CALLBACK procedure? 我想在鼠标单击时清理编辑框,我应该在LRESULT CALLBACK过程中使用哪个事件?

#define IDC_MAIN_EDIT 102 
HWND hEdit;

Firstly, you need to handle the WM_SETFOCUS message. 首先,您需要处理WM_SETFOCUS消息。 The next thing you need to do, is clear the text as your question states. 您需要做的下一件事是清除文本,如您的问题所述。 In which case you can send WM_SETTEXT with a \\0 or a null pointer, see here 在这种情况下,您可以使用\\0或空指针发送WM_SETTEXT ,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM