private void btnNfP_Click(object sender, EventArgs e)
 {
     if (File.Exists(Application.StartupPath + "/Data/Schedule.xml"))
     {
         XmlDocument xmlDoc = new XmlDocument();
         xmlDoc.Load(Application.StartupPath + "/Data/Schedule.xml");
         XmlElement root = xmlDoc.DocumentElement;
         XmlNodeList Tasks = root.GetElementsByTagName("Tasks");
         if (Tasks.Count > 0)
         {
             if (bListSelected == true)
             {
                 strScheduleMode = "NFP";
                 //btnDetail.Enabled = false;
                 //btnNfP.Enabled = false;
                 //btnEdit.Enabled = false;
                 //btnDelete.Enabled = false;
                 iIndex = -1;
                 PanelChart.Invalidate();
                 lstSchedule.SelectedItems.Clear();
                 NewSchedule ns = new NewSchedule();
                 ns.ShowDialog();
                 PanelChart.Invalidate();
             }
         }
     }
 }
 private void btnNew_Click(object sender, EventArgs e)
 {
     strScheduleMode = "N";
     iIndex = -1;
     PanelChart.Invalidate();
     lstSchedule.SelectedItems.Clear();
     NewSchedule ns = new NewSchedule();
     ns.ShowDialog();
     PanelChart.Invalidate();
 }