public void TextLabel_Click(object sender, EventArgs e) { CustomLabel textlabel = (CustomLabel)sender; if (currentQuestion != null) { currentQuestion.TextLabel.BackColor = Color.White; } //Console.WriteLine(textlabel.Text); currentQuestion = textlabel.Owner; currentQuestion.TextLabel.BackColor = Color.GreenYellow; questionChart.Series["Series1"].Points.Clear(); questionNameLabel.Text = "Question # : " + (currentQuestion.ID + 1).ToString(); CalculateTotals(); }
public void CreateQuestions(int number) { StringReader file = null; try { file = new StringReader(IBMConsultantTool.Properties.Resources.Questions); int i = 0; while ((line = file.ReadLine()) != null) { CupeQuestion q = new CupeQuestion(); // currentPerson.Questions.AddLast(q); q.TextLabel.Location = new Point(10, (30 * i) + 5); q.ID = i; q.TextLabel.Text = line; q.QuestionText = line; q.CurrentBox.Location = new Point(250, 30 * i); q.FutureBox.Location = new Point(310, 30 * i); q.CurrentBox.TextChanged += new EventHandler(CurrentBox_TextChanged); q.FutureBox.TextChanged += new EventHandler(FutureBox_TextChanged); q.TextLabel.Click += new EventHandler(TextLabel_Click); i++; q.Owner = panel1; mainQuestions.Add(q); //Console.WriteLine("something"); } } finally { if (file != null) { file.Close(); } } }
public CustomLabel(CupeQuestion owner) { this.owner = owner; }
public CustomBox(CupeQuestion owner) { this.owner = owner; }
public void CreateQuestions(int number) { StringReader file = null; try { file = new StringReader(IBMConsultantTool.Properties.Resources.Questions); int i = 0; while ((line = file.ReadLine()) != null) { CupeQuestion q = new CupeQuestion(); // currentPerson.Questions.AddLast(q); q.TextLabel.Location = new Point(10, (30 * i) + 5); q.ID = i; q.TextLabel.Text = line; q.QuestionText = line; q.CurrentBox.Location = new Point(250, 30 * i); q.FutureBox.Location = new Point(310, 30 * i); q.CurrentBox.TextChanged += new EventHandler(CurrentBox_TextChanged); q.FutureBox.TextChanged += new EventHandler(FutureBox_TextChanged); q.TextLabel.Click +=new EventHandler(TextLabel_Click); i++; q.Owner = panel1; mainQuestions.Add(q); //Console.WriteLine("something"); } } finally { if (file != null) file.Close(); } }
public void TextLabel_Click(object sender, EventArgs e) { CustomLabel textlabel = (CustomLabel)sender; if(currentQuestion != null) currentQuestion.TextLabel.BackColor = Color.White; //Console.WriteLine(textlabel.Text); currentQuestion = textlabel.Owner; currentQuestion.TextLabel.BackColor = Color.GreenYellow; questionChart.Series["Series1"].Points.Clear(); questionNameLabel.Text = "Question # : " + (currentQuestion.ID + 1).ToString(); CalculateTotals(); }