Page 1 of 1

How to En-Disabling checkboxes in the legend

Posted: Mon Apr 03, 2006 8:40 pm
by 9637279
Hi,

I plot multiple series which can be turned on and off through the checkboxes in the associated legend. Works nicely.

How can I enable/disable particular checkboxes in the legend to prevent the user from un-checking or checking a particular series according to
some criteria?

Thanks,
fano

Posted: Tue Apr 04, 2006 8:45 am
by narcis
Hi fano,

Just set the series you want ShowInLegend property to false as shown here:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      line1.FillSampleValues();
      line2.FillSampleValues();
      line3.FillSampleValues();

      line2.ShowInLegend = false;

      tChart1.Legend.CheckBoxes = true;
    }