I have a source file called RoundBtn.cpp with its header file RoundBtn.h
these two files are responsable for coloring the entier buttons on my Dialog. What i need to do is to give one of my button a special color. Some of the code for coloring all buttons is given below.
void RoundBtn::DrawItem(LPDRAWITEMSTRUCT lp)
{
CRect rc = lp->rcItem;
CDC dc;
dc.Attach(lp->hDC);
dc.SetBkMode(TRANSPARENT);
CBrush br;
br.CreateStockObject(NULL_BRUSH);
dc.SelectObject(&br);
if (is_pressed)
{
CPen pen(PS_SOLID, 2, RGB(0,0,0));
dc.SelectObject(&pen);
CBrush *pBrush=new CBrush(RGB(220,100,220));
dc.SelectObject(pBrush);
dc.RoundRect(0, 0, rc.Width(), rc.Height(), rc.Height()/1, rc.Height()/1);
dc.SetTextColor(RGB(0, 0, 0));
What I have tried:
What sould i change on my main file or what sould i call on my main file to color the button. the button ID Adress is
IDM_APPLY
and its function is
void CVCDlg::Apply1()
{
OnButtonApplyrange();
}