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.

Sponsored Links