Click here to Skip to main content
15,904,935 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help on recordsets Pin
swapna_signsin4-Apr-06 3:00
swapna_signsin4-Apr-06 3:00 
GeneralRe: Help on recordsets Pin
thatsme_cool4-Apr-06 19:30
thatsme_cool4-Apr-06 19:30 
Questiondatabase heros please help me? Pin
J51219823-Apr-06 21:06
J51219823-Apr-06 21:06 
AnswerRe: database heros please help me? Pin
includeh103-Apr-06 21:10
includeh103-Apr-06 21:10 
QuestionRe: database heros please help me? Pin
J51219823-Apr-06 21:35
J51219823-Apr-06 21:35 
AnswerRe: database heros please help me? Pin
includeh104-Apr-06 0:37
includeh104-Apr-06 0:37 
GeneralRe: database heros please help me? Pin
J51219824-Apr-06 19:51
J51219824-Apr-06 19:51 
QuestionHow to handle lost focus in DrawItem of Button Pin
Sarvan AL3-Apr-06 20:59
Sarvan AL3-Apr-06 20:59 
Hi all,

This is the code, I've written in my Button class:

void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
   CDC dc;<br />
   dc.Attach(lpDrawItemStruct->hDC);<br />
   CRect rt;<br />
   rt = lpDrawItemStruct->rcItem;<br />
<br />
   UINT state = lpDrawItemStruct->itemState; <br />
   if ( (state & ODS_SELECTED) )<br />
      dc.DrawEdge(rt,EDGE_SUNKEN,BF_RECT);<br />
   else<br />
      dc.DrawEdge(rt,EDGE_RAISED,BF_RECT);<br />
	<br />
   dc.SetTextColor(m_colText);<br />
<br />
   CString strTemp;<br />
   GetWindowText(strTemp);<br />
<br />
   dc.DrawText<br />
      (strTemp,rt,DT_CENTER|DT_VCENTER|DT_SINGLELINE);<br />
<br />
   if ( (state & ODS_FOCUS ) )<br />
   {<br />
	int iChange = 3;<br />
	rt.top += iChange;<br />
		rt.left += iChange;<br />
		rt.right -= iChange;<br />
		rt.bottom -= iChange;<br />
		dc.DrawFocusRect(rt);<br />
   }<br />
   dc.Detach();<br />
}


The focus rectangle is still there even it is lost the focus. How should I handle this ?

IMPORTANT
**********
If you could see my previous post, titled "MDI and ResizeParentToFit()", and give your thoughts, it would be more helpful.

It is here:
http://www.codeproject.com/script/comments/forums.asp?msg=1433452&forumid=1647&mode=all&userid=2355322#xx1433452xx[^]

Thanks in advance,
Saravanan AR
AnswerRe: How to handle lost focus in DrawItem of Button Pin
includeh103-Apr-06 21:15
includeh103-Apr-06 21:15 
AnswerRe: How to handle lost focus in DrawItem of Button Pin
Hamid_RT3-Apr-06 21:32
Hamid_RT3-Apr-06 21:32 
GeneralRe: How to handle lost focus in DrawItem of Button Pin
Sarvan AL3-Apr-06 22:01
Sarvan AL3-Apr-06 22:01 
Questionerror C2065: 'CWnd' : undeclared identifier (reposting with addl info) Pin
giftsana3-Apr-06 20:57
giftsana3-Apr-06 20:57 
AnswerRe: error C2065: 'CWnd' : undeclared identifier (reposting with addl info) Pin
includeh103-Apr-06 21:04
includeh103-Apr-06 21:04 
AnswerRe: error C2065: 'CWnd' : undeclared identifier (reposting with addl info) Pin
Cedric Moonen3-Apr-06 21:04
Cedric Moonen3-Apr-06 21:04 
Questionerror C2065: 'CWnd' : undeclared identifier Pin
giftsana3-Apr-06 20:55
giftsana3-Apr-06 20:55 
AnswerRe: error C2065: 'CWnd' : undeclared identifier Pin
sunit53-Apr-06 21:01
sunit53-Apr-06 21:01 
Questiongaming software Pin
includeh103-Apr-06 20:44
includeh103-Apr-06 20:44 
AnswerRe: gaming software Pin
Vasudevan Deepak Kumar3-Apr-06 20:52
Vasudevan Deepak Kumar3-Apr-06 20:52 
GeneralRe: gaming software Pin
includeh103-Apr-06 20:58
includeh103-Apr-06 20:58 
Questionsockets Pin
jpms3-Apr-06 20:17
jpms3-Apr-06 20:17 
AnswerRe: sockets Pin
sunit53-Apr-06 20:22
sunit53-Apr-06 20:22 
GeneralRe: sockets Pin
jpms3-Apr-06 20:55
jpms3-Apr-06 20:55 
GeneralRe: sockets Pin
YaronNir3-Apr-06 21:46
YaronNir3-Apr-06 21:46 
GeneralRe: sockets Pin
jpms4-Apr-06 1:03
jpms4-Apr-06 1:03 
QuestionHow to get the "module" associated with a thread, as the "ProcessExplorer" dose? Pin
davidforlc3-Apr-06 20:10
davidforlc3-Apr-06 20:10 

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.