Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to clear the user input to the edit box?

Status
Not open for further replies.

kaya17

Programmer
Feb 9, 2004
78
0
0
SG
i have an edit box which asked user to key in some infor,
then i added a button to clear what user keyed in,which method should i use to do that?

thanks!
 
are you using Win32 API / MFC / ?

SendMessage(hMyEditBox, WM_SETTEXT, (WPARAM)"", (LPARAM)1);
or
SetWindowText(hMyEditBox, "");

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
Or if the edit is already mapped to a CEdit object variable you just put edtBox.SetWindowText("")

bdiamond
 
YEAH!!~~
the SetWindowText("");
works! thanks again bdiamond! and thanks Skute!!!

Regards,
kaya

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top