Click here to Skip to main content
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 3: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 Sergey Alexandrovich Kryukov 420
1 OriginalGriff 344
2 Peter Leow 200
3 John C Rayan 126
4 CHill60 90
0 Sergey Alexandrovich Kryukov 7,393
1 OriginalGriff 5,711
2 Peter Leow 4,157
3 CHill60 2,858
4 Mika Wendelius 2,850

Advertise | Privacy | Mobile
Web03 | 2.8.150224.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