Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


1)How to change a text of a button in runtime?

Answers were Sorted based on User's Feedback



1)How to change a text of a button in runtime?..

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

1)How to change a text of a button in runtime?..

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

Post New Answer

More MFC Interview Questions

What types of threads are supported by MFC framework?

2 Answers  


What view class enables you to use an edit control as a view?

1 Answers  


How to update windows title bar dynamically?

7 Answers   HCL,


how many types of messages are their

4 Answers   E Logic, TCS,


Psychic Window Technique

2 Answers   E Logic, Wild Net,


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

8 Answers  


How to update all the views whenver document got updated ?

1 Answers  


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,


How many types of dialog box are their

10 Answers   Honeywell,


what is the use of Mutex and critical section

2 Answers  


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.

3 Answers   ABC, HCL, Infosys,


Hi can anyone explain about the synchronization objects types and where we are using in the code.

1 Answers  


Categories