I'm looking for a function, that would clean all EditText fields in a dialog - something like reset in HTML Forms...
Thanks for help!
I'm looking for a function, that would clean all EditText fields in a dialog - something like reset in HTML Forms...
Thanks for help!
I've never heard of such a function, but search MSDN to be sure. Is there a reason you can't just write a function to do this yourself? Why don't you know what text fields there are on a form?
There isn't an API function to do this, but the code to implement it is fairly straight forward.
Code:BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { char empty = 0; char className[32]; GetClassName(hwnd,className,sizeof(className)); if(!strcmp(className,"Edit")) SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)&empty); return TRUE; } BOOL ClearDlgEdits(HWND hwndDlg) { return EnumChildWindows(hwndDlg,EnumChildProc,0); }
thanks for code, but i found one different solution:
SetDlgItemText(hwnd, IDC_TEXT1, "");
i have to write this for each Edit field, but I have only 4 fields in Dialog.
Thanks for help anyway!