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...


how to give colour for dialog button or static buuto?any
one explain full code ?pls pls

Answers were Sorted based on User's Feedback



how to give colour for dialog button or static buuto?any one explain full code ?pls pls..

Answer / abhishek kesharwani

Brush *brush;
Initialize the brush pointer in the constructor of your Dialog
Code:
brush = new CBrush(RGB(49,49,49));
Add the WM_CTLCOLR Message handler for the dialog and add the following code
Code:
switch (nCtlColor) {

case CTLCOLOR_BTN:
pDC->SetTextColor(RGB(0, 255, 0));
pDC->SetBkColor(RGB(0, 0, 0));
return (HBRUSH)(brush->GetSafeHandle());
default:
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}

Is This Answer Correct ?    2 Yes 1 No

how to give colour for dialog button or static buuto?any one explain full code ?pls pls..

Answer / harinish

use wm_drawitem function to color the button or static box

Is This Answer Correct ?    1 Yes 5 No

how to give colour for dialog button or static buuto?any one explain full code ?pls pls..

Answer / pranesh archak

Subclass the control (button or static control) and use
message refelction for message handling.

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More MFC Interview Questions

19)how to set Back Ground Picture to a Dialog Box in MFC ?

1 Answers  


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


What is the base class for MFC Framework ?

4 Answers  


In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?

2 Answers   Wipro,


how does the UIThread and worker thread communicates and handle events

2 Answers   HCL,


How to update windows title bar dynamically?

7 Answers   HCL,


Which CPrintInfo member variable must be set for multiple page printouts?

1 Answers  


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


What is the difference between hinsrtance and hprevinstance in WinMain function?

3 Answers  


What is model and modeless dialog box ? Give some examples?

2 Answers   Mphasis,


what is the use of CCmdTarget?

4 Answers   Siemens,


Why Array Index starts from Zero

30 Answers   HCL,


Categories