Click here to Skip to main content
15,905,144 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function Enquiry Pin
Programm3r3-Apr-07 2:22
Programm3r3-Apr-07 2:22 
QuestionRe: Function Enquiry Pin
prasad_som3-Apr-07 1:41
prasad_som3-Apr-07 1:41 
AnswerRe: Function Enquiry Pin
Programm3r3-Apr-07 2:05
Programm3r3-Apr-07 2:05 
QuestionGDI+ & MFC - Resizing problem Pin
FreeCastle2-Apr-07 23:54
FreeCastle2-Apr-07 23:54 
AnswerRe: GDI+ & MFC - Resizing problem Pin
Parthi_Appu2-Apr-07 23:59
Parthi_Appu2-Apr-07 23:59 
GeneralRe: GDI+ & MFC - Resizing problem Pin
FreeCastle3-Apr-07 1:01
FreeCastle3-Apr-07 1:01 
GeneralRe: GDI+ & MFC - Resizing problem Pin
Parthi_Appu3-Apr-07 1:15
Parthi_Appu3-Apr-07 1:15 
GeneralRe: GDI+ & MFC - Resizing problem Pin
FreeCastle3-Apr-07 2:01
FreeCastle3-Apr-07 2:01 
Yes I know that cx and cy will also work. But I wanted to be completely sure, so I used GetClientRectangle. The result is anyway the same.

When I don't call "Invalidate" in the OnSize Handler then my dialog won't clear out the old contents (this will be then first done when I hide and show it again).

Here is some example code (all placed in my simple dialog class):

I have the following attributes:
<br />
Graphics* m_Canvas; //the GDI+ Graphics object to draw some stuff<br />
RECT m_rcRect; //holds the actual client rectangle of the window<br />


And the following methods:
<br />
OnPaint() <br />
{<br />
   drawLines();<br />
   CDialog::OnPaint();<br />
}<br />
<br />
OnSize(UINT nType,int cx, int cy)<br />
{<br />
   CDialog::OnSize(nType,cx,cy);<br />
<br />
   m_rcRect.bottom = cy;<br />
   m_rcRect.right  = cx;<br />
<br />
   Invalidate();<br />
}<br />
<br />
drawLines()<br />
{<br />
    static bool bFirstCall = true;<br />
    static Pen pen(Color::Red);<br />
 <br />
    if (bFirstCall == true) {<br />
        m_Canvas = ::new Graphics(m_hWnd);<br />
        bFirstCall = false;<br />
    }<br />
<br />
    m_Canvas->DrawLine(&pen,10,10,m_rcRect.right-10-10,10);<br />
    m_Canvas->DrawLine(&pen,10,10,10,m_rcRect.bottom-10-10);<br />
}<br />

GeneralRe: GDI+ &amp; MFC - Resizing problem Pin
Parthi_Appu3-Apr-07 2:16
Parthi_Appu3-Apr-07 2:16 
GeneralRe: GDI+ &amp; MFC - Resizing problem Pin
FreeCastle3-Apr-07 3:17
FreeCastle3-Apr-07 3:17 
GeneralRe: GDI+ &amp; MFC - Resizing problem Pin
Mark Salsbery3-Apr-07 8:19
Mark Salsbery3-Apr-07 8:19 
QuestionCircle Equation Pin
faridah_hani2-Apr-07 23:24
faridah_hani2-Apr-07 23:24 
AnswerRe: Circle Equation Pin
_AnsHUMAN_ 2-Apr-07 23:43
_AnsHUMAN_ 2-Apr-07 23:43 
QuestionRe: Circle Equation Pin
David Crow3-Apr-07 2:56
David Crow3-Apr-07 2:56 
AnswerRe: Circle Equation Pin
Hamid_RT3-Apr-07 6:18
Hamid_RT3-Apr-07 6:18 
Questionwindows recycle bin Pin
apoluo2-Apr-07 23:14
apoluo2-Apr-07 23:14 
AnswerRe: windows recycle bin Pin
Parthi_Appu3-Apr-07 0:07
Parthi_Appu3-Apr-07 0:07 
GeneralRe: windows recycle bin Pin
apoluo3-Apr-07 4:42
apoluo3-Apr-07 4:42 
GeneralRe: windows recycle bin Pin
apoluo3-Apr-07 4:44
apoluo3-Apr-07 4:44 
AnswerRe: windows recycle bin Pin
Hamid_RT3-Apr-07 6:18
Hamid_RT3-Apr-07 6:18 
Questionlinker problem VS2005 and lua library Pin
abac_mefisto2-Apr-07 22:58
abac_mefisto2-Apr-07 22:58 
GeneralRe: linker problem VS2005 and lua library Pin
prasad_som3-Apr-07 1:53
prasad_som3-Apr-07 1:53 
QuestionRe: linker problem VS2005 and lua library Pin
abac_mefisto3-Apr-07 2:19
abac_mefisto3-Apr-07 2:19 
AnswerRe: linker problem VS2005 and lua library Pin
prasad_som3-Apr-07 2:33
prasad_som3-Apr-07 2:33 
GeneralRe: linker problem VS2005 and lua library Pin
abac_mefisto3-Apr-07 2:23
abac_mefisto3-Apr-07 2:23 

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.