Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

You should put your drawing stuff inside the Form::Paint event handler, see Control::Paint Event[^].
 
Share this answer
 
Comments
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.
Use endless loops.

C++
while(true){
//Your drawing code
}


Or

C++
for(;;){
//Your drawing code
}


You should probably make a Windows Form control for this, and run the endless loop in a separate thread.
 
Share this answer
 
Comments
nv3 11-Apr-13 9:02am    
Are you serious?
[no name] 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900