CheckBox and Static control problem
-
Hello, I am working on an mfc application. In it I am using a static control and a checkbox. I am using a Picture control on top of it i have placed the checkbox and static control. The problem is that the background of checkbox and static control is not tranparent as a result of which the picture colour and background colours of the controls are not matching.. please help me. Thanks & regards. Dhiraj Kumar Saini
-
Hello, I am working on an mfc application. In it I am using a static control and a checkbox. I am using a Picture control on top of it i have placed the checkbox and static control. The problem is that the background of checkbox and static control is not tranparent as a result of which the picture colour and background colours of the controls are not matching.. please help me. Thanks & regards. Dhiraj Kumar Saini
You might want this.
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC) wParam;
HWND hwndStatic = (HWND) lParam;
HBRUSH hbrBkcolor = (HBRUSH)GetStockObject(NULL_BRUSH);if (hwndStatic == GetDlgItem(hWnd, IDC\_STATIC\_CONTROL)) { SetBkMode(hdc, TRANSPARENT); return (LRESULT) hbrBkcolor; } break;
}
Same stuff do with your Check Box also.. Hope this help.
-
Hello, I am working on an mfc application. In it I am using a static control and a checkbox. I am using a Picture control on top of it i have placed the checkbox and static control. The problem is that the background of checkbox and static control is not tranparent as a result of which the picture colour and background colours of the controls are not matching.. please help me. Thanks & regards. Dhiraj Kumar Saini
Greets. You could try handling the WM_CTLCOLOR (or WM_CTLCOLORBTN and/or WM_CTLCOLORSTATIC) messages in the parent window and return a NULL brush. Am not sure that would work, haven't tried it but it's worth a shot.
AtomAnt - If God wanted man to code, man would have been born without the need to sleep.
-
You might want this.
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC) wParam;
HWND hwndStatic = (HWND) lParam;
HBRUSH hbrBkcolor = (HBRUSH)GetStockObject(NULL_BRUSH);if (hwndStatic == GetDlgItem(hWnd, IDC\_STATIC\_CONTROL)) { SetBkMode(hdc, TRANSPARENT); return (LRESULT) hbrBkcolor; } break;
}
Same stuff do with your Check Box also.. Hope this help.
I am using MFC and not win32 . Please help me with MFC code as i dont know win32. Thanks
-
I am using MFC and not win32 . Please help me with MFC code as i dont know win32. Thanks
May be this help.. http://bobmoore.mvps.org/Win32/w32tip37.htm[^]
-
May be this help.. http://bobmoore.mvps.org/Win32/w32tip37.htm[^]
Its not working. Please tell me whats the problem.
-
Its not working. Please tell me whats the problem.
Please tell him what is not working. Unless one of you two has psychic powers, you need to help him to help you. Iain.
-
Please tell him what is not working. Unless one of you two has psychic powers, you need to help him to help you. Iain.
:^) I also think so...