Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: color of button control Pin
ashish dogra22-Jun-06 20:20
ashish dogra22-Jun-06 20:20 
GeneralRe: color of button control Pin
ashish dogra22-Jun-06 21:13
ashish dogra22-Jun-06 21:13 
QuestionRe: color of button control Pin
Hamid_RT22-Jun-06 21:59
Hamid_RT22-Jun-06 21:59 
AnswerRe: color of button control Pin
ashish dogra22-Jun-06 22:04
ashish dogra22-Jun-06 22:04 
GeneralRe: color of button control [modified] Pin
Hamid_RT22-Jun-06 22:18
Hamid_RT22-Jun-06 22:18 
GeneralRe: color of button control Pin
anothervip22-Jun-06 19:59
anothervip22-Jun-06 19:59 
AnswerRe: color of button control Pin
Hamid_RT22-Jun-06 19:22
Hamid_RT22-Jun-06 19:22 
AnswerRe: color of button control Pin
Hamid_RT22-Jun-06 21:58
Hamid_RT22-Jun-06 21:58 
I think you need to one code so see this you need to insert this code in your project for one start
m_Button.ModifyStyle(0,BS_OWNERDRAW); //in your main class insert this code
m_Button is CMyButton1
//////////////////

///////////in header file
class CMyButton1 : public CButton
{
	DECLARE_DYNAMIC(CMyButton1)

public:
	CMyButton1();
	virtual ~CMyButton1();
protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};


IMPLEMENT_DYNAMIC(CMyButton1, CButton)
CMyButton1::CMyButton1()
{
}

CMyButton1::~CMyButton1()
{
}


BEGIN_MESSAGE_MAP(CMyButton1, CButton)
	
END_MESSAGE_MAP()

void CMyButton1::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
CRect rt;
rt = lpDrawItemStruct->rcItem;


dc.SetBkMode(0);

CString str;
GetWindowText(str);

if ( (lpDrawItemStruct->itemState & ODS_SELECTED) )
{
dc.FrameRect(&rt,&CBrush(RGB(110,170,210)));
dc.SetTextColor(RGB(0,0,0));
dc.FillRect(&rt,&CBrush(RGB(190,210,210)));
}
else
{
dc.FrameRect(&rt,&CBrush(RGB(0,0,0)));
dc.SetTextColor(RGB(255,255,255));
dc.FillRect(&rt,&CBrush(RGB(100,170,210)));
}
dc.DrawText(str,rt,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
dc.Detach();
}

</code>




whitesky


QuestionImap Client Implementation Pin
answer_me22-Jun-06 19:08
answer_me22-Jun-06 19:08 
AnswerRe: Imap Client Implementation Pin
Ștefan-Mihai MOGA22-Jun-06 22:11
professionalȘtefan-Mihai MOGA22-Jun-06 22:11 
QuestionLINK : fatal error LNK1104: cannot open file "atls.lib" Pin
dashprasannajit22-Jun-06 18:28
dashprasannajit22-Jun-06 18:28 
AnswerRe: LINK : fatal error LNK1104: cannot open file "atls.lib" Pin
led mike22-Jun-06 19:49
led mike22-Jun-06 19:49 
GeneralRe: LINK : fatal error LNK1104: cannot open file "atls.lib" Pin
David Crow23-Jun-06 3:29
David Crow23-Jun-06 3:29 
GeneralRe: LINK : fatal error LNK1104: cannot open file "atls.lib" Pin
led mike25-Jun-06 7:46
led mike25-Jun-06 7:46 
QuestionVC++ DATABASE MANAGEMENT Pin
moodsey21122-Jun-06 15:58
moodsey21122-Jun-06 15:58 
AnswerRe: VC++ DATABASE MANAGEMENT Pin
_AnsHUMAN_ 22-Jun-06 17:42
_AnsHUMAN_ 22-Jun-06 17:42 
AnswerRe: VC++ DATABASE MANAGEMENT Pin
Hamid_RT22-Jun-06 19:53
Hamid_RT22-Jun-06 19:53 
AnswerRe: VC++ DATABASE MANAGEMENT Pin
David Crow23-Jun-06 3:30
David Crow23-Jun-06 3:30 
QuestionCreateService error Pin
zt978822-Jun-06 15:57
zt978822-Jun-06 15:57 
QuestionRe: CreateService error Pin
David Crow23-Jun-06 3:33
David Crow23-Jun-06 3:33 
QuestionHow to make a WinForm run on 95/98/2000/XP... Pin
Raffi NYC22-Jun-06 15:04
Raffi NYC22-Jun-06 15:04 
AnswerRe: How to make a WinForm run on 95/98/2000/XP... Pin
Jun Du22-Jun-06 16:04
Jun Du22-Jun-06 16:04 
GeneralRe: How to make a WinForm run on 95/98/2000/XP... Pin
Raffi NYC22-Jun-06 16:29
Raffi NYC22-Jun-06 16:29 
AnswerRe: How to make a WinForm run on 95/98/2000/XP... Pin
David Crow23-Jun-06 3:35
David Crow23-Jun-06 3:35 
GeneralRe: How to make a WinForm run on 95/98/2000/XP... Pin
Raffi NYC23-Jun-06 12:05
Raffi NYC23-Jun-06 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.