1)How to change a text of a button in runtime?
Answers were Sorted based on User's Feedback
Answer / jp
1. Only required to know the Control Resource ID
((CButton*)GetDlgItem(IDOK))->SetWindowText(_T("Hello"));
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ps
1. make a control variable of button with the Cbutton class;
2. where you want to change the text then call only setwindowtext();
in header file;
Cbutton mButton;.
IN RESOURCE.H...
#DEFINE BUTTON_ID 249;// CONTROLL ID NUMBER 249 ANY YOU WNT OR SYSTEM GENRATED.
in cpp file.
'''''''mesage map
ABC::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, BUTTON_ID, mButton);
}
BOOL ABC::OnInitDialog()
{
// IF USER CHANGE ON INIT METHOD THEN CAN DO OR CHANGE IN ANY METHOD WITH THE SAME CLASS
mButton.setwindowText(_T"hello");
}
| Is This Answer Correct ? | 0 Yes | 1 No |
What types of threads are supported by MFC framework?
What view class enables you to use an edit control as a view?
How to update windows title bar dynamically?
how many types of messages are their
Psychic Window Technique
How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)When it gets called? c)how it comes to message queue? Please Explain it
How to update all the views whenver document got updated ?
if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?
How many types of dialog box are their
what is the use of Mutex and critical section
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header ("Include") Files.
Hi can anyone explain about the synchronization objects types and where we are using in the code.