📄 frmscore.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Example_1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmScore : System.Windows.Forms.Form
{
private System.Windows.Forms.ProgressBar pBar1;
private System.Windows.Forms.Label lblScoreMessage;
private System.Windows.Forms.Button btnExit;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public frmScore()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pBar1 = new System.Windows.Forms.ProgressBar();
this.lblScoreMessage = new System.Windows.Forms.Label();
this.btnExit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// pBar1
//
this.pBar1.Location = new System.Drawing.Point(29, 52);
this.pBar1.Maximum = 30;
this.pBar1.Name = "pBar1";
this.pBar1.Size = new System.Drawing.Size(173, 24);
this.pBar1.TabIndex = 0;
//
// lblScoreMessage
//
this.lblScoreMessage.Location = new System.Drawing.Point(29, 17);
this.lblScoreMessage.Name = "lblScoreMessage";
this.lblScoreMessage.Size = new System.Drawing.Size(173, 25);
this.lblScoreMessage.TabIndex = 1;
this.lblScoreMessage.Text = "您的分数如下所示:";
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(144, 103);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(58, 26);
this.btnExit.TabIndex = 2;
this.btnExit.Text = "退出";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// frmScore
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(220, 143);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.lblScoreMessage);
this.Controls.Add(this.pBar1);
this.Name = "frmScore";
this.Text = "分数";
this.Load += new System.EventHandler(this.frmScore_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
// Display score using Progressbar
private void frmScore_Load(object sender, System.EventArgs e)
{
MessageBox.Show (frmQuestions.score.ToString());
pBar1.Value = frmQuestions.score;
}
// Quit application
private void btnExit_Click(object sender, System.EventArgs e)
{
Application.Exit ();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -