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
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 |
Answer / harinish
use wm_drawitem function to color the button or static box
| Is This Answer Correct ? | 1 Yes | 5 No |
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 |
what is the meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?
What function is used to disable a control at runtime?
What function is called by a document class to notify views that the document has been changed?
How to handle RTTI in MFC ?
Explain in sort What is CTargetObject?
What is LoadLibrary function returns?
What MFC base classes provide support for ActiveX controls?
How can i change the color of a dropdowncombobox elements
What is a message map, and what is the advantage of a message map over virtual functions?
I can i set size of integer variable should be fixed for different operating systems(Ex i want integer size is 2bytes in OS)
What is mfc class hierarchy?
Hi can anyone explain about the synchronization objects types and where we are using in the code.