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

📄 form1.cs

📁 java基础方面的一些实例代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace mcaoWinAppControl
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.ListBox listBox2;
		private System.Windows.Forms.TextBox TID;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.TextBox textBox3;
		private System.Windows.Forms.Button PrevT;
		private System.Windows.Forms.Button TNext;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.ComboBox MulQuery;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button3;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.RadioButton SqlB;
		private System.Windows.Forms.RadioButton OledbB;
		private System.Windows.Forms.GroupBox groupBox4;
		private System.Windows.Forms.CheckBox chkDisableMax;
		private System.Windows.Forms.CheckBox chkDisableShow;
		private System.Windows.Forms.MainMenu mainMenu1;
		private System.Windows.Forms.MenuItem menuFile;
		private System.Windows.Forms.MenuItem menuItem2;
		private System.Windows.Forms.MenuItem menuEdit;
		private System.Windows.Forms.MenuItem menuAbout;
		private System.Windows.Forms.MenuItem menuItem5;
		private System.Windows.Forms.MenuItem menuItem6;
		private System.Windows.Forms.MenuItem menuItem7;
		private System.Windows.Forms.MenuItem menuItem8;
		private System.Windows.Forms.MenuItem menuItem9;
		private System.Windows.Forms.MenuItem menuItem10;
		private System.Windows.Forms.ToolTip toolTip1;
		private System.Windows.Forms.StatusBar statusBar1;
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.ToolBarButton toolBarFileExit;
		private System.Windows.Forms.ToolBarButton toolBarAbout;
		private System.Windows.Forms.LinkLabel linkLabel1;
		private System.Windows.Forms.GroupBox groupBox5;
		private System.Windows.Forms.CheckedListBox checkedListBox1;
		private System.Windows.Forms.TextBox textBox2;
		private System.Windows.Forms.Button button4;
		private System.Windows.Forms.Button button5;
		private System.Windows.Forms.Button button6;
		private System.Windows.Forms.TabControl tabControl1;
		private System.Windows.Forms.TabPage tabPage1;
		private System.Windows.Forms.TabPage tabPage2;
		private System.Windows.Forms.DateTimePicker dateTimePicker1;
		private System.Windows.Forms.GroupBox groupBox6;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.GroupBox groupBox7;
		private System.Windows.Forms.TrackBar trackBar1;
		private System.Windows.Forms.HScrollBar hScrollBar1;
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.Timer timer1;
		private System.Windows.Forms.StatusBarPanel statusBarPanel1;
		private System.Windows.Forms.StatusBarPanel statusBarPanel2;
		private System.Windows.Forms.GroupBox groupBox8;
		private System.Windows.Forms.TreeView treeView1;
		private System.Windows.Forms.NotifyIcon notifyIcon1;
		private System.Windows.Forms.GroupBox groupBox9;
		private System.Windows.Forms.ProgressBar progressBar1;
		private System.Windows.Forms.Label MyProcessBarPersent;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label StopProcessBar;
		private System.Windows.Forms.GroupBox groupBox10;
		private System.Windows.Forms.DomainUpDown domainUpDown1;
		private System.Windows.Forms.NumericUpDown numericUpDown1;
		private System.Windows.Forms.HScrollBar hPictureScrollBar;
		private System.Windows.Forms.VScrollBar vPictureScrollBar;
		private System.Windows.Forms.Panel panelPicture;
		private System.Windows.Forms.GroupBox groupBox11;
		private System.Windows.Forms.Label OpenLabel;
		private System.Windows.Forms.Label SaveLabel;
		private System.Windows.Forms.Label BrowseLabel;
		private System.Windows.Forms.Label FontLabel;
		private System.Windows.Forms.Label ColorLabel;
		private System.Windows.Forms.Label PrintLabel;
		private System.Windows.Forms.Label PrintViewLabel;
		private System.Windows.Forms.Label SetupLabel;
		private System.Windows.Forms.Label ResultLabel;
		private System.Windows.Forms.OpenFileDialog MyOenFileDialog;
		private System.Windows.Forms.SaveFileDialog MySaveFileDialog;
		private System.Windows.Forms.FolderBrowserDialog MyFolderBrowserDialog;
		private System.Windows.Forms.FontDialog MyFontDialog;
		private System.Windows.Forms.ColorDialog MyColorDialog;
		private System.Windows.Forms.PrintDialog MyPrintDialog;
		private System.Windows.Forms.PageSetupDialog MyPageSetupDialog;
		private System.Drawing.Printing.PrintDocument MyPrintDocument;
		private System.Windows.Forms.PrintPreviewDialog MyPrintPreviewDialog;
		private System.ComponentModel.IContainer components;

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//linkLabel1.Links.Add(0, 2, "www.shu.edu.cn");
			//linkLabel1.Links.Add(2, 15, "www.tsinghua.edu.cn");

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

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

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.listBox2 = new System.Windows.Forms.ListBox();
			this.TID = new System.Windows.Forms.TextBox();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.textBox3 = new System.Windows.Forms.TextBox();
			this.PrevT = new System.Windows.Forms.Button();
			this.TNext = new System.Windows.Forms.Button();
			this.button3 = new System.Windows.Forms.Button();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.MulQuery = new System.Windows.Forms.ComboBox();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.SqlB = new System.Windows.Forms.RadioButton();
			this.OledbB = new System.Windows.Forms.RadioButton();
			this.groupBox4 = new System.Windows.Forms.GroupBox();
			this.chkDisableShow = new System.Windows.Forms.CheckBox();
			this.chkDisableMax = new System.Windows.Forms.CheckBox();
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.menuFile = new System.Windows.Forms.MenuItem();
			this.menuItem2 = new System.Windows.Forms.MenuItem();
			this.menuEdit = new System.Windows.Forms.MenuItem();
			this.menuItem5 = new System.Windows.Forms.MenuItem();
			this.menuItem6 = new System.Windows.Forms.MenuItem();
			this.menuItem7 = new System.Windows.Forms.MenuItem();
			this.menuItem8 = new System.Windows.Forms.MenuItem();
			this.menuItem10 = new System.Windows.Forms.MenuItem();
			this.menuItem9 = new System.Windows.Forms.MenuItem();
			this.menuAbout = new System.Windows.Forms.MenuItem();
			this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
			this.textBox2 = new System.Windows.Forms.TextBox();
			this.button4 = new System.Windows.Forms.Button();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.trackBar1 = new System.Windows.Forms.TrackBar();
			this.linkLabel1 = new System.Windows.Forms.LinkLabel();
			this.StopProcessBar = new System.Windows.Forms.Label();
			this.statusBar1 = new System.Windows.Forms.StatusBar();
			this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.toolBarFileExit = new System.Windows.Forms.ToolBarButton();
			this.toolBarAbout = new System.Windows.Forms.ToolBarButton();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.groupBox5 = new System.Windows.Forms.GroupBox();
			this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
			this.button5 = new System.Windows.Forms.Button();
			this.button6 = new System.Windows.Forms.Button();
			this.tabControl1 = new System.Windows.Forms.TabControl();
			this.tabPage1 = new System.Windows.Forms.TabPage();
			this.tabPage2 = new System.Windows.Forms.TabPage();
			this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
			this.groupBox6 = new System.Windows.Forms.GroupBox();
			this.groupBox7 = new System.Windows.Forms.GroupBox();
			this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.groupBox8 = new System.Windows.Forms.GroupBox();
			this.treeView1 = new System.Windows.Forms.TreeView();
			this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
			this.groupBox9 = new System.Windows.Forms.GroupBox();
			this.MyProcessBarPersent = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.progressBar1 = new System.Windows.Forms.ProgressBar();
			this.label1 = new System.Windows.Forms.Label();
			this.groupBox10 = new System.Windows.Forms.GroupBox();
			this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
			this.domainUpDown1 = new System.Windows.Forms.DomainUpDown();
			this.hPictureScrollBar = new System.Windows.Forms.HScrollBar();
			this.vPictureScrollBar = new System.Windows.Forms.VScrollBar();
			this.panelPicture = new System.Windows.Forms.Panel();
			this.groupBox11 = new System.Windows.Forms.GroupBox();
			this.OpenLabel = new System.Windows.Forms.Label();
			this.SaveLabel = new System.Windows.Forms.Label();
			this.BrowseLabel = new System.Windows.Forms.Label();
			this.FontLabel = new System.Windows.Forms.Label();
			this.ColorLabel = new System.Windows.Forms.Label();
			this.PrintLabel = new System.Windows.Forms.Label();
			this.PrintViewLabel = new System.Windows.Forms.Label();
			this.SetupLabel = new System.Windows.Forms.Label();
			this.ResultLabel = new System.Windows.Forms.Label();
			this.MyOenFileDialog = new System.Windows.Forms.OpenFileDialog();
			this.MySaveFileDialog = new System.Windows.Forms.SaveFileDialog();
			this.MyFolderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
			this.MyFontDialog = new System.Windows.Forms.FontDialog();
			this.MyColorDialog = new System.Windows.Forms.ColorDialog();
			this.MyPrintDialog = new System.Windows.Forms.PrintDialog();
			this.MyPageSetupDialog = new System.Windows.Forms.PageSetupDialog();
			this.MyPrintDocument = new System.Drawing.Printing.PrintDocument();
			this.MyPrintPreviewDialog = new System.Windows.Forms.PrintPreviewDialog();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.groupBox3.SuspendLayout();
			this.groupBox4.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
			this.groupBox5.SuspendLayout();
			this.tabControl1.SuspendLayout();
			this.groupBox6.SuspendLayout();
			this.groupBox7.SuspendLayout();
			this.groupBox8.SuspendLayout();
			this.groupBox9.SuspendLayout();
			this.groupBox10.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
			this.panelPicture.SuspendLayout();
			this.groupBox11.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.listBox2);
			this.groupBox1.Controls.Add(this.TID);
			this.groupBox1.Controls.Add(this.textBox1);
			this.groupBox1.Controls.Add(this.textBox3);
			this.groupBox1.Controls.Add(this.PrevT);
			this.groupBox1.Controls.Add(this.TNext);
			this.groupBox1.Controls.Add(this.button3);
			this.groupBox1.Location = new System.Drawing.Point(8, 48);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(152, 144);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "listBox and Edit Test";
			// 
			// listBox2
			// 
			this.listBox2.ItemHeight = 12;
			this.listBox2.Location = new System.Drawing.Point(68, 32);
			this.listBox2.Name = "listBox2";
			this.listBox2.Size = new System.Drawing.Size(72, 64);
			this.listBox2.TabIndex = 8;
			// 
			// TID
			// 
			this.TID.AcceptsReturn = true;
			this.TID.AcceptsTab = true;
			this.TID.Location = new System.Drawing.Point(12, 48);
			this.TID.Name = "TID";
			this.TID.Size = new System.Drawing.Size(40, 21);
			this.TID.TabIndex = 7;
			this.TID.Text = "ID";
			this.toolTip1.SetToolTip(this.TID, "输入1-10之间的正整数");
			// 
			// textBox1
			// 
			this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.textBox1.Enabled = false;
			this.textBox1.Location = new System.Drawing.Point(8, 24);
			this.textBox1.Name = "textBox1";
			this.textBox1.ReadOnly = true;
			this.textBox1.Size = new System.Drawing.Size(56, 14);
			this.textBox1.TabIndex = 3;
			this.textBox1.TabStop = false;
			this.textBox1.Text = "教师工号";
			// 
			// textBox3
			// 
			this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.textBox3.Enabled = false;
			this.textBox3.Location = new System.Drawing.Point(76, 16);
			this.textBox3.Name = "textBox3";
			this.textBox3.ReadOnly = true;
			this.textBox3.Size = new System.Drawing.Size(56, 14);
			this.textBox3.TabIndex = 4;
			this.textBox3.TabStop = false;
			this.textBox3.Text = "所开课程";
			// 
			// PrevT
			// 
			this.PrevT.Location = new System.Drawing.Point(8, 104);
			this.PrevT.Name = "PrevT";
			this.PrevT.Size = new System.Drawing.Size(40, 24);
			this.PrevT.TabIndex = 5;
			this.PrevT.Text = "加入";
			this.toolTip1.SetToolTip(this.PrevT, "将编辑框中的文字加入到列表框中");
			this.PrevT.Click += new System.EventHandler(this.PrevT_Click);
			// 
			// TNext
			// 
			this.TNext.Location = new System.Drawing.Point(56, 104);
			this.TNext.Name = "TNext";
			this.TNext.Size = new System.Drawing.Size(40, 24);
			this.TNext.TabIndex = 6;
			this.TNext.Text = "删除";
			this.TNext.Click += new System.EventHandler(this.TNext_Click);
			// 
			// button3
			// 
			this.button3.Location = new System.Drawing.Point(104, 104);
			this.button3.Name = "button3";
			this.button3.Size = new System.Drawing.Size(40, 24);
			this.button3.TabIndex = 6;
			this.button3.Text = "结果";
			this.button3.Click += new System.EventHandler(this.button3_Click);
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.MulQuery);
			this.groupBox2.Controls.Add(this.button1);
			this.groupBox2.Controls.Add(this.button2);
			this.groupBox2.Location = new System.Drawing.Point(8, 192);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(152, 88);
			this.groupBox2.TabIndex = 0;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Combobox Test";
			// 
			// MulQuery
			// 
			this.MulQuery.AllowDrop = true;
			this.MulQuery.Location = new System.Drawing.Point(16, 22);
			this.MulQuery.Name = "MulQuery";
			this.MulQuery.Size = new System.Drawing.Size(120, 20);
			this.MulQuery.TabIndex = 1;
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(72, 56);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(64, 24);
			this.button1.TabIndex = 6;
			this.button1.Text = "目前选择";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// button2
			// 

⌨️ 快捷键说明

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