boedeker
asked on
Setting pushbutton caption
I'm pretty new to MFC, and I have the following problem:
I simply want to change the the caption of a pushbutton so that when the user clicks it, the text changes from "Start" to "Stop"or vice versa. I don't want to use bitmaps, and I don't want to create two buttons and show/hide them - I would like to learn how to programatically change the text of just one button.
In an MFC created dialog-based app called MyTest, with classes MyTest and MyTestDlg, and a pushbutton called ID_START_STOP, how do I implement this feature ?
Thanks a lot,
Boedeker
I simply want to change the the caption of a pushbutton so that when the user clicks it, the text changes from "Start" to "Stop"or vice versa. I don't want to use bitmaps, and I don't want to create two buttons and show/hide them - I would like to learn how to programatically change the text of just one button.
In an MFC created dialog-based app called MyTest, with classes MyTest and MyTestDlg, and a pushbutton called ID_START_STOP, how do I implement this feature ?
Thanks a lot,
Boedeker
ASKER
Thanks for the answer snoegler - it works fine, so post anything as an answer and I'll give you the points :)
Boedeker
Boedeker
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(perhaps in the OnStartStop handler function):
CString newCaption;
// set newCaption to the desired text
GetDlgItem(ID_START_STOP)-
I would suggest that you re-open this question with 50 points - 100 points are really much for
this question :) :) :)