|
-
September 17th, 1999, 04:14 PM
#1
Need some help with OnCtlColor please...
yoo gurus....
can you please help me with lil something here?
i have dialog base app and this is my OnCtlColor class..
HBRUSH CDlgClass::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
//pDC->SetTextColor(RGB(0,0,255));
if(pWnd==GetDlgItem(IDC_RADIO1))
pDC->SetTextColor(RGB(255,0,0));//this dosent work why?
return hbr;
}
now i wanna set diffrent colors for some controls
but it dosent work...
any ideas guys??
and my second question is how can i change the color of the conrol (radio buttons and check boxes) when the mouse is over them??
thanks in advance
kishk91
[email protected]
http://www.path.co.il
ICQ: 13610258
-
September 17th, 1999, 04:17 PM
#2
Re: Need some help with OnCtlColor please...
HBRUSH CCHXServerConfig::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
switch(nCtlColor)
{
case CTLCOLOR_LISTBOX:
case CTLCOLOR_EDIT:
// Set color to green on black and return the backgroundbrush.
pDC->SetTextColor(RGB(0, 255, 0));
pDC->SetBkColor(RGB(96, 96, 96));
return (HBRUSH)(m_pEditBackgroundColor->GetSafeHandle());
case CTLCOLOR_STATIC:
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkColor(RGB(192, 192, 128));
return (HBRUSH)(m_pDialogColor->GetSafeHandle());
case CTLCOLOR_BTN:
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkColor(RGB(192, 192, 128));
return (HBRUSH)(m_pButtoncolor->GetSafeHandle());
case CTLCOLOR_DLG:
return (HBRUSH)(m_pDialogColor->GetSafeHandle());
}
return (HBRUSH)(m_pButtoncolor->GetSafeHandle());
}
-
September 17th, 1999, 04:25 PM
#3
Re: Need some help with OnCtlColor please...
ok.. this will change all the static control to some color and so on..
but what if i have IDC_RADIO1 IDC_RADIO2 and IDC_RADIO3
how do i change the color of IDC_RADIO1 only..
?
[email protected]
http://www.path.co.il
ICQ: 13610258
-
September 17th, 1999, 04:33 PM
#4
Re: Need some help with OnCtlColor please...
Sounds to me like you should do owner draw for your radio buttons. That means handling owner draw and measure item messages.
-
September 17th, 1999, 04:41 PM
#5
Re: Need some help with OnCtlColor please...
ok.. but i use the dialog boxes editor...
and in the properties of the controls i dont have
owner draw option...
so how do i handle this??
[email protected]
http://www.path.co.il
ICQ: 13610258
-
March 6th, 2001, 04:38 PM
#6
Re: Need some help with OnCtlColor please...
Hi
I have the same problem that you had here. Did you fix it ? Can you help me?
Jase
<no witty trailer supplied>
Jase
www.slideshowdesktop.com
View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|