Menu

How to completely clear an ZedControl?

Help
Shmuel
2005-06-02
2012-09-19
  • Shmuel

    Shmuel - 2005-06-02

    I have several ZedGraphControls on my form, when I go to reuse them with new data, I do the following:

    myZed.GraphPane.CurveList.Clear();
    myZed.GraphPane.GraphItemList.Clear();

    but I find that the Axis value (YAxis.Min, etc.) retain their values from the previous use. Is there a function to completely "reset" the control?

     
    • John Champion

      John Champion - 2005-06-02

      Try this:

      myZed.GraphPane = new GraphPane(
      myZed.GraphPane.PaneRect,
      "New Title", "New X Axis", "New Y Axis" );
      myZed.Refresh();

      This just completely replaces the GraphPane, only keeping the original paneRect.
      John

       

Log in to post a comment.

MongoDB Logo MongoDB