CodePudding user response:
Define a static variable records, make its increment per clickCodePudding user response:
Inside the button of "click" event to do statistics,CodePudding user response:
A member variable or a global variable you understandCodePudding user response:
Global variableCodePudding user response:
See you want to statistics button clicks is start form every time a recount or close the window, still can continue to statistics, the former can make a class member variable statistics, which need to be on the basis of the previous step to add a write files or registry action to record statisticsCodePudding user response:
Static variables, the member variable or a global variable can be, and then click the event since, if need to be on the outside of the function call, you don't define the static variablesCodePudding user response:
Header files define inside int clickNum;Dialog box inside the constructor of the assignment=0;
Then click event inside LButtonDown clickNum++ inside;
And then to display
Cstrings STR="" '
STR. The Format (" % d ", clickNum);
MessageBox (STR);
Will definitely get the
CodePudding user response:
Add a counter where LButtonDown events directlyCodePudding user response:
Weak weak ask, how to realize the click button displays a text, and then point the same button shows another textCodePudding user response:
Dialog box class, for example1, in the header file CxxxxDlg. Add variable h
Int n;
2, in CxxxxDlg. CPP add initialization:
N=0;
In 3, double click on the button control, add
n++;
Cstrings STR.
STR. The Format (_T (" % d "), n);
SetDlgItemText (IDC_EDIT1, STR);