本文整理汇总了C#中System.Windows.Forms.Panel.SetAutoScrollMargin方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.SetAutoScrollMargin方法的具体用法?C# Panel.SetAutoScrollMargin怎么用?C# Panel.SetAutoScrollMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.SetAutoScrollMargin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMainPanel
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);
}