⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.cs

📁 一个好的系统 对初学者很有用啊 来看看啊
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ExamCenter.BLCTier;
using System.IO;
namespace ExamCenter.FormTier
{
	/// <summary>
	/// FrmMain 的摘要说明。
	/// </summary>
	public class FrmMain : System.Windows.Forms.Form
	{
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		//将这个变量声明为静态变量是为了减少窗体之间的传递	
		private static int intUserId=-1;
		private static string strUsecasename = "";
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.TreeView trFunction;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Panel panel3;
		private System.Windows.Forms.Label lblExit;
		private System.Windows.Forms.Label lblFile;
		private System.Windows.Forms.Label lblTool;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button3;
		private System.Windows.Forms.Button button4;
		private System.Windows.Forms.Button button5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Panel panel4;
		private System.Windows.Forms.Label lblLogin;
		private System.Windows.Forms.Label lblCalc;
		private System.Windows.Forms.Label lblAbout;
		private System.Windows.Forms.Label lblHelp;
		private System.Windows.Forms.ContextMenu CnmenuMain;
		private System.Windows.Forms.ContextMenu CnmenuTool;
		private System.Windows.Forms.ContextMenu Cnhelp;
		private System.Windows.Forms.Label lblTitle;
		private System.ComponentModel.IContainer components = null;

		//记录用户id
		public static int IntUserID
		{
			get{ return intUserId;}
			set{ intUserId=value;}
		}
                //记录用户名
		public static string StrUserName
		{
			get
			{
				if (FrmMain.IntUserID != -1)
					return new UserBLC().GetUserById(FrmMain.IntUserID).Tables[0].Rows[0]["usercname"].ToString();
				else
					return "用户名不存在";
			}
		}

              //记录用户点击的窗体名
		public static string StrUsecasename
		{
			get
			{
				return strUsecasename;
			}
			set
			{
				strUsecasename = value;
			}
		}

		public FrmMain()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();							
			this.RefreshTree();			
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.trFunction = new System.Windows.Forms.TreeView();
            this.lblExit = new System.Windows.Forms.Label();
            this.lblFile = new System.Windows.Forms.Label();
            this.lblTool = new System.Windows.Forms.Label();
            this.lblHelp = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            this.button5 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.lblLogin = new System.Windows.Forms.Label();
            this.button4 = new System.Windows.Forms.Button();
            this.lblCalc = new System.Windows.Forms.Label();
            this.lblAbout = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.panel4 = new System.Windows.Forms.Panel();
            this.CnmenuMain = new System.Windows.Forms.ContextMenu();
            this.CnmenuTool = new System.Windows.Forms.ContextMenu();
            this.Cnhelp = new System.Windows.Forms.ContextMenu();
            this.lblTitle = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // imageList1
            // 
            this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
            this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
            this.imageList1.Images.SetKeyName(0, "");
            this.imageList1.Images.SetKeyName(1, "");
            // 
            // trFunction
            // 
            this.trFunction.BackColor = System.Drawing.SystemColors.Window;
            this.trFunction.ImageIndex = 0;
            this.trFunction.ImageList = this.imageList1;
            this.trFunction.Location = new System.Drawing.Point(8, 97);
            this.trFunction.Name = "trFunction";
            this.trFunction.SelectedImageIndex = 1;
            this.trFunction.Size = new System.Drawing.Size(222, 495);
            this.trFunction.TabIndex = 1;
            this.trFunction.DoubleClick += new System.EventHandler(this.trFunction_DoubleClick);
            // 
            // lblExit
            // 
            this.lblExit.BackColor = System.Drawing.Color.Transparent;
            this.lblExit.Location = new System.Drawing.Point(770, 1);
            this.lblExit.Name = "lblExit";
            this.lblExit.Size = new System.Drawing.Size(27, 19);
            this.lblExit.TabIndex = 3;
            this.lblExit.Click += new System.EventHandler(this.lblExit_Click);
            // 
            // lblFile
            // 
            this.lblFile.BackColor = System.Drawing.Color.Transparent;
            this.lblFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.lblFile.Location = new System.Drawing.Point(16, 33);
            this.lblFile.Name = "lblFile";
            this.lblFile.Size = new System.Drawing.Size(77, 20);
            this.lblFile.TabIndex = 4;
            this.lblFile.Text = "【文件(&F)】";
            this.lblFile.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.lblFile.Enter += new System.EventHandler(this.lblFile_Enter);
            this.lblFile.MouseLeave += new System.EventHandler(this.lblFile_MouseLeave);
            this.lblFile.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblFile_MouseMove);
            // 
            // lblTool
            // 
            this.lblTool.BackColor = System.Drawing.Color.Transparent;
            this.lblTool.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.lblTool.Location = new System.Drawing.Point(100, 33);
            this.lblTool.Name = "lblTool";
            this.lblTool.Size = new System.Drawing.Size(79, 20);
            this.lblTool.TabIndex = 5;
            this.lblTool.Text = "【工具(&T)】";
            this.lblTool.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.lblTool.Enter += new System.EventHandler(this.lblTool_Enter);
            this.lblTool.MouseLeave += new System.EventHandler(this.lblTool_MouseLeave);
            this.lblTool.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblTool_MouseMove);
            // 
            // lblHelp
            // 
            this.lblHelp.BackColor = System.Drawing.Color.Transparent;
            this.lblHelp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.lblHelp.Location = new System.Drawing.Point(192, 33);
            this.lblHelp.Name = "lblHelp";
            this.lblHelp.Size = new System.Drawing.Size(79, 20);
            this.lblHelp.TabIndex = 6;
            this.lblHelp.Text = "【帮助(&H)】";
            this.lblHelp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.lblHelp.Enter += new System.EventHandler(this.lblHelp_Enter);
            this.lblHelp.MouseLeave += new System.EventHandler(this.lblHelp_MouseLeave);
            this.lblHelp.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblHelp_MouseMove);
            // 
            // label2
            // 
            this.label2.BackColor = System.Drawing.SystemColors.Window;
            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.label2.Location = new System.Drawing.Point(7, 52);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(783, 3);
            this.label2.TabIndex = 7;
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.Transparent;
            this.panel1.Controls.Add(this.button5);
            this.panel1.Controls.Add(this.button1);
            this.panel1.Controls.Add(this.button3);
            this.panel1.Controls.Add(this.lblLogin);
            this.panel1.Controls.Add(this.button4);
            this.panel1.Controls.Add(this.lblCalc);
            this.panel1.Controls.Add(this.lblAbout);
            this.panel1.Location = new System.Drawing.Point(7, 56);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(783, 33);
            this.panel1.TabIndex = 8;
            // 
            // button5
            // 
            this.button5.Location = new System.Drawing.Point(189, 4);
            this.button5.Name = "button5";
            this.button5.Size = new System.Drawing.Size(3, 25);
            this.button5.TabIndex = 12;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(14, 3);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(3, 25);
            this.button1.TabIndex = 9;
            // 
            // button3
            // 
            this.button3.Location = new System.Drawing.Point(19, 3);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(3, 25);
            this.button3.TabIndex = 10;
            // 
            // lblLogin
            // 
            this.lblLogin.BackColor = System.Drawing.Color.Transparent;
            this.lblLogin.Image = ((System.Drawing.Image)(resources.GetObject("lblLogin.Image")));
            this.lblLogin.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.lblLogin.Location = new System.Drawing.Point(37, 6);
            this.lblLogin.Name = "lblLogin";
            this.lblLogin.Size = new System.Drawing.Size(46, 23);
            this.lblLogin.TabIndex = 10;
            this.lblLogin.Text = "登录";
            this.lblLogin.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            this.lblLogin.Click += new System.EventHandler(this.lblLogin_Click);
            // 
            // button4
            // 
            this.button4.Location = new System.Drawing.Point(97, 3);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(3, 25);
            this.button4.TabIndex = 11;
            // 
            // lblCalc
            // 
            this.lblCalc.BackColor = System.Drawing.Color.Transparent;
            this.lblCalc.Image = ((System.Drawing.Image)(resources.GetObject("lblCalc.Image")));
            this.lblCalc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.lblCalc.Location = new System.Drawing.Point(104, 5);
            this.lblCalc.Name = "lblCalc";
            this.lblCalc.Size = new System.Drawing.Size(77, 23);
            this.lblCalc.TabIndex = 11;
            this.lblCalc.Text = "计算器";
            this.lblCalc.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            this.lblCalc.Click += new System.EventHandler(this.lblCalc_Click);
            // 
            // lblAbout
            // 
            this.lblAbout.BackColor = System.Drawing.Color.Transparent;
            this.lblAbout.Image = ((System.Drawing.Image)(resources.GetObject("lblAbout.Image")));
            this.lblAbout.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.lblAbout.Location = new System.Drawing.Point(202, 6);
            this.lblAbout.Name = "lblAbout";
            this.lblAbout.Size = new System.Drawing.Size(51, 23);
            this.lblAbout.TabIndex = 12;
            this.lblAbout.Text = "关于";
            this.lblAbout.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            this.lblAbout.Click += new System.EventHandler(this.lblAbout_Click);
            // 
            // label6
            // 
            this.label6.BackColor = System.Drawing.SystemColors.Window;
            this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.label6.Location = new System.Drawing.Point(9, 91);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(783, 3);
            this.label6.TabIndex = 10;
            // 
            // panel4
            // 
            this.panel4.BackColor = System.Drawing.Color.White;
            this.panel4.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel4.BackgroundImage")));
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel4.Location = new System.Drawing.Point(234, 97);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(558, 495);
            this.panel4.TabIndex = 11;
            this.panel4.Paint += new System.Windows.Forms.PaintEventHandler(this.panel4_Paint);
            // 
            // lblTitle
            // 
            this.lblTitle.BackColor = System.Drawing.Color.Transparent;
            this.lblTitle.ForeColor = System.Drawing.Color.White;
            this.lblTitle.Location = new System.Drawing.Point(264, 4);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new System.Drawing.Size(232, 21);
            this.lblTitle.TabIndex = 12;
            this.lblTitle.Text = "电子政务考试系统-考试中心子系统";
            this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // FrmMain
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.ClientSize = new System.Drawing.Size(799, 599);
            this.Controls.Add(this.lblTitle);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -