CODE help!

private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {

if(checkBox1->CheckState == CheckState::Checked)
{

this->chart2->ChartAreas[0]->auto
this->chart1->ChartAreas[0]->auto
this->chart3->ChartAreas[0]->auto



}
else if(checkBox1->CheckState == CheckState::Unchecked)
{

this->chart2->ChartAreas[0]->AxisY->Minimum = chart2->ChartAreas[0]->AxisY->Maximum;
this->chart2->ChartAreas[0]->AxisY->Maximum = chart2->ChartAreas[0]->AxisY->Minimum;

this->chart1->ChartAreas[0]->AxisY->Minimum = chart1->ChartAreas[0]->AxisY->Maximum;
this->chart1->ChartAreas[0]->AxisY->Maximum = chart1->ChartAreas[0]->AxisY->Minimum;

this->chart3->ChartAreas[0]->AxisY->Minimum = chart3->ChartAreas[0]->AxisY->Maximum;
this->chart3->ChartAreas[0]->AxisY->Maximum = chart3->ChartAreas[0]->AxisY->Minimum;

}


}

Errors: error C2059: syntax error : 'this'
error C2039: 'checkBox1' : is not a member of 'System::Windows::Forms::DataVisualization::Charting::ChartArea'
error C2039: 'CheckState' : is not a member of 'System::Windows::Forms::DataVisualization::Charting::ChartArea'

I found out through visual studio chart control.net that the graphs autosize by itself. I want to turn it on by clicking a check box, so I wrote this but I am getting errors. Can anyone help?
I'd say that you placed that function in the wrong class.
What's the name of the class that contains checkBox1?
I believe the class name is checkBox1_CheckedChanged
I believe the class name is checkBox1_CheckedChanged
No that's the function name.

Look at the error message:
System::Windows::Forms::DataVisualization::Charting::ChartArea


checkBox1 is obviously not in ChartArea.
Just search for the checkBox1 member variable.

Isn't the function automatically generated? How could it be in the wrong class?
I think that my problem might be that auto is not right for autoscaling. I found out that it autoscales by itself and I'm going to write a function that will set the boundaries to the maximum and minimum value when the box is checked.
Topic archived. No new replies allowed.