private void btnVisualize_Click(object sender, EventArgs e)
 {
     try
     {
         n = parser.ParseExpression(tbxInput.Text);
     }
     catch (Exception ex)
     {
         DirectMessage.ShowError(ex.Message);
     }
     this.pictureBoxGraph.Paint -= new System.Windows.Forms.PaintEventHandler(graphDrawer.DrawCoordinateSystem);
     graphDrawer = new GraphDrawer(n, chbHorizontalLabels.Checked, chbVerticalLabels.Checked, chbAxes.Checked, chbXY.Checked, chbFunction.Checked,
                                   chbInverseFunction.Checked, chbFunctionDerivative.Checked, chbFunctionIntegral.Checked, chbFunctionMaclaurin.Checked);
     this.pictureBoxGraph.Paint      += new System.Windows.Forms.PaintEventHandler(graphDrawer.DrawCoordinateSystem);
     graphDrawer.OnIntegralPrompted  += new GraphDrawer.FunctionDomainPrompt(HideFunctionIntegral);
     graphDrawer.OnMaclaurinPrompted += new GraphDrawer.FunctionDomainPrompt(HideFunctionMaclaurin);
     pictureBoxGraph.Refresh();
     cm.MenuItems.Clear();
     cm.MenuItems.Add("Export", new EventHandler(graphDrawer.ExportToPNG));
     if (settingsForm != null)
     {
         if (IsSettingsFormOpened())
         {
             settingsForm.Close();
             settingsForm = null;
             OpenSettingsForm();
         }
     }
     chbPolynomial.Checked = false;
     graphDrawer.DisablePolynomialMode();
     ActiveControl = null;
 }