Click here to Skip to main content
Rate this: bad
good
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
good
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[^].
  Permalink  
Comments
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
good
Please Sign up or sign in to vote.

Solution 1

Use endless loops.
 
while(true){
//Your drawing code
}
 
Or
 
for(;;){
//Your drawing code
}
 
You should probably make a Windows Form control for this, and run the endless loop in a separate thread.
  Permalink  
Comments
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 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2014
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