Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Newbie  »  Chart Success: Second Helpings of Pie. Part 3  »  Restart Option
 »  Home  »  Windows Development  »  Graphics  »  Chart Success: Second Helpings of Pie. Part 3  »  Restart Option
Chart Success: Second Helpings of Pie. Part 3
by Ged Mead | Published  03/23/2005 | .NET Newbie Graphics | Rating:
Restart Option

 

The Oops! Option
   

 We’re almost done.  The user can enter as much data as they like and the chart can be refreshed each time to display the data and the pattern/color choices.  But there may come a time when the user wants to start over again.

  Rather than forcing them to close the application and fire it up again, let’s finish off by giving them a button to remove the data and clear the decks for another go.

  This code in the Click event of the Restart button is all that is needed:

   Private Sub btnRestart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles  btnRestart.Click
        UserData.Clear()
        pnlChart.Invalidate()
    End Sub


Our new friend, the Invalidate method, once again does most of the work for us, once we have removed all data from the arraylist.

Comments    Submit Comment

Comment #1  (Posted by an unknown user on 03/25/2005)
Rating
The good is getting even better. Cool job, Ged.
 
Comment #2  (Posted by an unknown user on 04/19/2005)
Rating
an amazing series of articles! It difficult to explain in such a simple way has you did. Thanks
 
Comment #3  (Posted by Ronan on 04/13/2006)
Rating
Hi i have read these tutorials and am looking your help.
I am trying to develop a pie chart interface in Visual Studio 2003 for a PDA (Smart Device Application) and tried your code. however it is not compatible as it does not recognise the drawPie and FillPie commands, etc. Do you have an example i could use to help me for this?
Thank you, Ronan
 
Comment #4  (Posted by PeteB on 05/22/2006)
Rating
reall useful.
 
Comment #5  (Posted by an unknown user on 12/08/2006)
Rating
Very Educative
 
Comment #6  (Posted by an unknown user on 08/27/2007)
Rating
clear / simple
 
Sponsored Links