Ejemplo n.º 1
0
        private void createQuestionTabPage(int questionIndex, Data.SelfIntroductionQuestion question)
        {
            // 질문/답변 라벨
            Label questionLabel = new Label();

            questionLabel.AutoSize = true;
            questionLabel.Location = new System.Drawing.Point(18, 13);
            questionLabel.Size     = new System.Drawing.Size(29, 12);
            questionLabel.TabIndex = 0;
            questionLabel.Text     = "질문";
            Label answerLabel = new Label();

            answerLabel.AutoSize = true;
            answerLabel.Location = new System.Drawing.Point(18, 91);
            answerLabel.Name     = "answerLabel";
            answerLabel.Size     = new System.Drawing.Size(29, 12);
            answerLabel.TabIndex = 0;
            answerLabel.Text     = "답변";

            //
            // 글자수 세는 라벨
            //
            Label countLabel = new Label();

            countLabel.AutoSize = true;
            countLabel.Location = new System.Drawing.Point(18, 476);
            countLabel.Name     = "countLabel";
            countLabel.Size     = new System.Drawing.Size(87, 12);
            countLabel.TabIndex = 0;
            countLabel.Text     = "현재 글자수 : " + question.GetAnswer().Length;

            //
            // 텍스트박스와 패널 변수 선언
            //
            TextBox questionTextBox = new TextBox();
            TextBox answerTextBox   = new TextBox();
            Panel   panel           = new Panel();

            //
            // 탭페이지
            //
            TabPage tabpage = new TabPage();

            tabpage.Controls.Add(panel);
            tabpage.Location = new System.Drawing.Point(4, 22);
            tabpage.Name     = "tabpage";
            tabpage.Padding  = new System.Windows.Forms.Padding(3);
            tabpage.Size     = new System.Drawing.Size(652, 507);
            tabpage.TabIndex = 0;
            tabpage.Text     = (questionIndex + 1) + "번 질문";
            tabpage.Tag      = questionIndex;
            tabpage.UseVisualStyleBackColor = true;


            // 질문 텍스트박스

            questionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
            questionTextBox.Location     = new System.Drawing.Point(20, 28);
            questionTextBox.Multiline    = true;
            questionTextBox.Name         = "questionTextBox";
            questionTextBox.Size         = new System.Drawing.Size(600, 48);
            questionTextBox.TabIndex     = 1;
            questionTextBox.Text         = question.GetQuestion();
            questionTextBox.Tag          = questionIndex;
            questionTextBox.TextChanged += OnQuestionTextChanged;

            //
            // 답변 텍스트박스
            //
            answerTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
            answerTextBox.Location     = new System.Drawing.Point(20, 106);
            answerTextBox.Multiline    = true;
            answerTextBox.Name         = "answerTextBox";
            answerTextBox.Size         = new System.Drawing.Size(600, 367);
            answerTextBox.TabIndex     = 2;
            answerTextBox.Text         = question.GetAnswer();
            answerTextBox.Tag          = questionIndex;
            answerTextBox.TextChanged += OnAnswerTextChanged;

            // 패널
            panel.Dock     = System.Windows.Forms.DockStyle.Fill;
            panel.Location = new System.Drawing.Point(3, 3);
            panel.Name     = "panel";
            panel.Size     = new System.Drawing.Size(646, 501);
            panel.TabIndex = 0;
            panel.Controls.Add(questionLabel);
            panel.Controls.Add(answerLabel);
            panel.Controls.Add(countLabel);
            panel.Controls.Add(questionTextBox);
            panel.Controls.Add(answerTextBox);

            // 탭컨트롤에 추가
            tabControl1.Controls.Add(tabpage);
        }
Ejemplo n.º 2
0
 public SelfIntroductionQuestion(SelfIntroductionQuestion question)
 {
     SetQuestion(question.GetQuestion());
     SetAnswer(question.GetAnswer());
 }