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

1)How to load an icon on a button as Dynamically ?

1 Answers   HCL,


What is the use of CCmdTarget ?

4 Answers  


Given two processes, how can they share memory?

2 Answers   Microsoft,


What is the use of UpdateData funciton ?

7 Answers  


What is a message map?

1 Answers   Mphasis,






What is the difference between Extension DLL and Regular DLL?

6 Answers   GE,


What is LoadLibrary function returns?

7 Answers  


2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers

0 Answers   TCS,


Does the application have more than one object? If Yes, Briefly explain.

2 Answers   Soltius Infotech,


What is the difference between the SDI and MDI

3 Answers   Invensys,


what is the use of CCmdTarget?

4 Answers   Siemens,


What is socket?

3 Answers  


Categories