📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace csharp_win_viewer_events
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Button cmdLaunchReport;
internal System.Windows.Forms.Button cmdExit;
internal System.Windows.Forms.Label Label3;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// 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.Label2 = new System.Windows.Forms.Label();
this.cmdLaunchReport = new System.Windows.Forms.Button();
this.cmdExit = new System.Windows.Forms.Button();
this.Label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// Label2
//
this.Label2.Font = new System.Drawing.Font("Times New Roman", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.Label2.Location = new System.Drawing.Point(32, 16);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(264, 40);
this.Label2.TabIndex = 4;
this.Label2.Text = "Capture Viewer Events";
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// cmdLaunchReport
//
this.cmdLaunchReport.Location = new System.Drawing.Point(80, 72);
this.cmdLaunchReport.Name = "cmdLaunchReport";
this.cmdLaunchReport.Size = new System.Drawing.Size(168, 23);
this.cmdLaunchReport.TabIndex = 5;
this.cmdLaunchReport.Text = "Launch the Crystal Report";
this.cmdLaunchReport.Click += new System.EventHandler(this.cmdLaunchReport_Click);
//
// cmdExit
//
this.cmdExit.Location = new System.Drawing.Point(80, 123);
this.cmdExit.Name = "cmdExit";
this.cmdExit.Size = new System.Drawing.Size(168, 23);
this.cmdExit.TabIndex = 6;
this.cmdExit.Text = "EXIT";
this.cmdExit.Click += new System.EventHandler(this.cmdExit_Click);
//
// Label3
//
this.Label3.Location = new System.Drawing.Point(8, 168);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(312, 80);
this.Label3.TabIndex = 7;
this.Label3.Text = "NOTE: When you click \'Launch the Crystal Report\' a login error appears to demon" +
"strate the RaiseException event of the Windows Form Viewer. You will then be pr" +
"ompted to log on to the Northwind database (installed with Microsoft SQL Server " +
"by default).";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(328, 269);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.Label3,
this.cmdExit,
this.cmdLaunchReport,
this.Label2});
this.Name = "Form1";
this.Text = "Viewer Events";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void cmdLaunchReport_Click(object sender, System.EventArgs e)
{
frmViewer ViewerForm = new frmViewer();
ViewerForm.Show();
}
private void cmdExit_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -