Click here to Skip to main content
13,045,790 members (47,076 online)
Rate this:
Please Sign up or sign in to vote.
See more: (untagged)
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 11-Apr-13 9:03am
Right, that's the way to go.
lostandconfused1234 11-Apr-13 13:51pm
thank you!
CPallini 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 11-Apr-13 9:02am
Are you serious?
ThePhantomUpvoter 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2017
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