Click here to Skip to main content
15,886,850 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drawings disappear !!! Pin
llp00na21-Feb-06 7:20
llp00na21-Feb-06 7:20 
GeneralRe: Drawings disappear !!! Pin
David Crow21-Feb-06 9:04
David Crow21-Feb-06 9:04 
GeneralRe: Drawings disappear !!! Pin
llp00na22-Feb-06 2:05
llp00na22-Feb-06 2:05 
GeneralRe: Drawings disappear !!! Pin
Stephen Hewitt21-Feb-06 11:24
Stephen Hewitt21-Feb-06 11:24 
GeneralRe: Drawings disappear !!! Pin
Owner drawn21-Feb-06 16:46
Owner drawn21-Feb-06 16:46 
GeneralRe: Drawings disappear !!! Pin
David Crow22-Feb-06 2:43
David Crow22-Feb-06 2:43 
GeneralRe: Drawings disappear !!! Pin
Stephen Hewitt22-Feb-06 11:19
Stephen Hewitt22-Feb-06 11:19 
AnswerRe: Drawings disappear !!! partially solved Pin
llp00na21-Feb-06 7:34
llp00na21-Feb-06 7:34 
Now i have partially solved the problem. what i did was removing:
if(drawings == TRUE){
drawShapes(dc);
}
from the if clause and including in the else clause.

Now i can see the drawings. my only problem is that the drawings disappear if the dialog box is minimized or if another window is overlaid on top of the it.

Any suggestions are very welcome.

void CTestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon= GetSystemMetrics(SM_CYICON);

CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);


}
else
{
if(drawings == TRUE){
drawShapes(dc);
}
CDialog::OnPaint();
}
}

llp00na
AnswerRe: Drawings disappear !!! Pin
Michael Dunn21-Feb-06 8:33
sitebuilderMichael Dunn21-Feb-06 8:33 
GeneralRe: Drawings disappear !!! Pin
llp00na21-Feb-06 8:39
llp00na21-Feb-06 8:39 
GeneralRe: Drawings disappear !!! Pin
Michael Dunn21-Feb-06 9:15
sitebuilderMichael Dunn21-Feb-06 9:15 
Questionsending mail in vc++ Pin
renuchandran21-Feb-06 6:10
renuchandran21-Feb-06 6:10 
AnswerRe: sending mail in vc++ Pin
David Crow21-Feb-06 6:14
David Crow21-Feb-06 6:14 
AnswerRe: sending mail in vc++ Pin
ThatsAlok22-Feb-06 3:11
ThatsAlok22-Feb-06 3:11 
QuestionUsing Base Classes Pin
Desmond Mardle21-Feb-06 5:13
Desmond Mardle21-Feb-06 5:13 
QuestionRe: Using Base Classes Pin
David Crow21-Feb-06 5:33
David Crow21-Feb-06 5:33 
AnswerRe: Using Base Classes Pin
Desmond Mardle21-Feb-06 6:29
Desmond Mardle21-Feb-06 6:29 
QuestionRe: Using Base Classes Pin
David Crow21-Feb-06 7:11
David Crow21-Feb-06 7:11 
AnswerRe: Using Base Classes Pin
Bob Flynn21-Feb-06 5:39
Bob Flynn21-Feb-06 5:39 
QuestionLoop error Pin
Deviantizh21-Feb-06 5:11
Deviantizh21-Feb-06 5:11 
AnswerRe: Loop error Pin
David Crow21-Feb-06 5:37
David Crow21-Feb-06 5:37 
AnswerRe: Loop error Pin
Joe Woodbury21-Feb-06 5:49
professionalJoe Woodbury21-Feb-06 5:49 
GeneralRe: Loop error Pin
Deviantizh21-Feb-06 6:05
Deviantizh21-Feb-06 6:05 
QuestionRe: Loop error Pin
Deviantizh21-Feb-06 6:18
Deviantizh21-Feb-06 6:18 
AnswerRe: Loop error Pin
Joe Woodbury21-Feb-06 7:23
professionalJoe Woodbury21-Feb-06 7: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.