derickiv
April 24th, 2003, 02:59 AM
Hi,
I have drawn a Picture Box on Modal Dialog Box. Now I want to set the Background color of this Picture Box. pls help... Code I have tried is below... Its Win32 code
SetColor(HWND hwnd, COLORREF cr)
{
//hwnd is Dialogbox handle
HDC hdc;
HWND hwndPic;
//get the handle to picture box
hwndPic = GetDlgItem(hwnd,IDC_PIC);
//cretae DC for picture box
hdc = CreateDC(hwndPic);
//set the back ground color
SetBkColor(hdc,cr);
DeleteDC(hdc);
}
Thankx.......
I have drawn a Picture Box on Modal Dialog Box. Now I want to set the Background color of this Picture Box. pls help... Code I have tried is below... Its Win32 code
SetColor(HWND hwnd, COLORREF cr)
{
//hwnd is Dialogbox handle
HDC hdc;
HWND hwndPic;
//get the handle to picture box
hwndPic = GetDlgItem(hwnd,IDC_PIC);
//cretae DC for picture box
hdc = CreateDC(hwndPic);
//set the back ground color
SetBkColor(hdc,cr);
DeleteDC(hdc);
}
Thankx.......