Click here to Skip to main content
11,798,866 members (74,506 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++/CLI
I have a dialog box which draws a graph. I use the ->DrawLine method.

The issue is, if the screen is miminised and maximised again the window of course redraws itself. It doesn't however draw the graph because that's not the default window. How do I override the paint to draw my graph again? Or is there a "permanent" draw method? I'm using Windows Forms.

The only function of the dialog box is to draw this graph, so there isn't any trouble in having a drawline straight to the window is there?

Thanks for reading
Posted 11-Apr-13 2:23am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You should put your drawing stuff inside the Form::Paint event handler, see Control::Paint Event[^].
nv3 at 11-Apr-13 9:03am
Right, that's the way to go.
lostandconfused1234 at 11-Apr-13 13:51pm
thank you!
CPallini at 11-Apr-13 15:25pm
You are welcome.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use endless loops.

//Your drawing code


//Your drawing code

You should probably make a Windows Form control for this, and run the endless loop in a separate thread.
nv3 at 11-Apr-13 9:02am
Are you serious?
ThePhantomUpvoter at 11-Apr-13 10:02am
O.O No!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 505
1 OriginalGriff 503
2 Richard MacCutchan 321
3 Maciej Los 245
4 phil.o 244
0 OriginalGriff 2,270
1 Maciej Los 1,810
2 KrunalRohit 1,496
3 CPallini 1,425
4 Richard MacCutchan 1,109

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100