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 CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example
How to handle RTTI in MFC ?
How you create a button dynamically?
How can server communicate with more than one client
What is CArchive class dowes?
What is mfc class hierarchy?
Can you explaing the relashionship between document,frame and view ?
1)At run-time, you can change the icon by calling the LoadIcon() function?
What is the difference between workrer thread and UI thread
Hi can anyone explain about the synchronization objects types and where we are using in the code.
How we can findout Memoryleaks, In what way it can be avoided
What is a message map, and what is the advantage of a message map over virtual functions?