internal void addQuestion(Question newQuestion, bool lineUp) { this.lineUpQuestions = lineUp; QuestionUI newQuestionUI = new QuestionUI(newQuestion); questionsUIList.Add(newQuestionUI); pnlControls.Controls.Add(newQuestionUI.Label); pnlControls.Controls.Add(newQuestionUI.TextBox); newQuestionUI.TextBox.KeyUp += textbox_KeyUp; newQuestionUI.Label.SendToBack(); }
/// <summary> /// Add a Question into the TextFormStep /// </summary> /// <param name="textQuestion">The question of the text</param> /// <param name="answer">A default or previously-provided answer</param> /// <returns></returns> public Question AddQuestion(string textQuestion, string answer) { var result = new Question(textQuestion); result.Answer = answer; registerQuestion(result); return result; }
/// <summary> /// Add a Question into the TextFormStep /// </summary> /// <param name="textQuestion"></param> public Question AddQuestion(string textQuestion) { var newQuestion = new Question(textQuestion); registerQuestion(newQuestion); return newQuestion; }
/// <summary> /// Adds a new question to the UI, question list. /// Must be called for every question added in any way. /// </summary> private void registerQuestion(Question q) { questions.Add(q); ui.addQuestion(q, this.LineUpQuestions); }
internal QuestionUI(Question question) { this.Label = new Label(); this.Label.AutoSize = false; this.Label.Text = question.QuestionText; Label.AutoEllipsis = true; this.TextBox = new TextBox(); this.TextBox.Text = question.Answer; this.QuestionInfo = question; }