Exemplo n.º 1
0
        private void CreateMainPanel()
        {
            // Initialize panel
            AnswerQuestionPanel = new Panel();
            AnswerQuestionPanel.Name = "QuestionView";
            AnswerQuestionPanel.BackColor = Color.Transparent;
            AnswerQuestionPanel.Height = Screen.PrimaryScreen.Bounds.Height;
            AnswerQuestionPanel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            AnswerQuestionPanel.Location = new Point(225, 0);
            AnswerQuestionPanel.BorderStyle = BorderStyle.Fixed3D;
            AnswerQuestionPanel.AutoScroll = true;
            AnswerQuestionPanel.SetAutoScrollMargin(0, 100);

            // Initialize question label
            Question.Name = "Vraag";
            Question.Text = ListofQuestions[counter].title;
            Question.Location = new Point(400, 75);
            Height = (Question.Text.Length + 100);
            Question.Size = new Size(750, Height);
            Question.Font = new Font("Segoe Print", 23f);
            AnswerQuestionPanel.Controls.Add(Question);

            // Initialize seperationline
            Label SeperationLine = new Label();
            SeperationLine.AutoSize = false;
            SeperationLine.Height = 3;
            SeperationLine.Width = 750;
            SeperationLine.BorderStyle = BorderStyle.Fixed3D;
            SeperationLine.Location = new Point(400, Height + 75);
            AnswerQuestionPanel.Controls.Add(SeperationLine);

            // Initialize stop button
            Stop.Name = "Stop";
            Stop.Text = char.ConvertFromUtf32(8592);
            Stop.Location = new Point(20, Height - 100);
            Stop.Size = new Size(75, 50);
            Stop.Font = new Font("Segoe Print", 17f);
            Stop.ForeColor = Color.White;
            Stop.FlatStyle = FlatStyle.Flat;
            Stop.FlatAppearance.BorderColor = Color.White;
            Stop.FlatAppearance.BorderSize = 2;
            Stop.MouseClick += new MouseEventHandler(Stop_Click);
            Stop.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            AnswerQuestionPanel.Controls.Add(Stop);

            // Initialize back button
            Back.Name = "Back";
            Back.Text = "Vorige";
            Back.Location = new Point(430, Height + 675);
            Back.Size = new Size(200, 50);
            Back.Font = new Font("Segoe Print", 17f);
            Back.ForeColor = Color.White;
            Back.FlatStyle = FlatStyle.Flat;
            Back.FlatAppearance.BorderColor = Color.White;
            Back.FlatAppearance.BorderSize = 2;
            Back.MouseClick += new MouseEventHandler(Back_Click);
            Back.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            Back.Enabled = false;
            AnswerQuestionPanel.Controls.Add(Back);

            // Initialize next button
            Next.Name = "Next";
            if(ListofQuestions.Count == 1)
            {
                Next.Text = "Afronden";
            } else
            {
                Next.Text = "Volgende";
            }
            Next.Location = new Point(930, Height + 675);
            Next.Size = new Size(200, 50);
            Next.Font = new Font("Segoe Print", 17f);
            Next.ForeColor = Color.White;
            Next.FlatStyle = FlatStyle.Flat;
            Next.FlatAppearance.BorderColor = Color.White;
            Next.FlatAppearance.BorderSize = 2;
            Next.Enabled = true;
            Next.MouseClick += new MouseEventHandler(Next_Click);
            Next.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            AnswerQuestionPanel.Controls.Add(Next);
        }