📄 formoption.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace ProfileCtrl
{
/// <summary>
///比例尺设置类
/// </summary>
public class FormOption : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox textCaption;
private System.Windows.Forms.TextBox textY;
private System.Windows.Forms.TextBox textX;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public FormOption()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
textCaption.Text=PublicValue.caption;
textX.Text=PublicValue.scaleX.ToString();
textY.Text = PublicValue.scaleY.ToString();
//
// 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.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.textCaption = new System.Windows.Forms.TextBox();
this.textY = new System.Windows.Forms.TextBox();
this.textX = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.btnCancel.Location = new System.Drawing.Point(194, 90);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消";
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.btnOK.Location = new System.Drawing.Point(90, 90);
this.btnOK.Name = "btnOK";
this.btnOK.TabIndex = 2;
this.btnOK.Text = "确定";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textCaption);
this.groupBox2.Controls.Add(this.textY);
this.groupBox2.Controls.Add(this.textX);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Location = new System.Drawing.Point(10, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(336, 76);
this.groupBox2.TabIndex = 7;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "请输入剖面图名称:";
//
// textCaption
//
this.textCaption.Location = new System.Drawing.Point(8, 17);
this.textCaption.Name = "textCaption";
this.textCaption.Size = new System.Drawing.Size(320, 21);
this.textCaption.TabIndex = 1;
this.textCaption.Text = "";
//
// textY
//
this.textY.Location = new System.Drawing.Point(244, 46);
this.textY.Name = "textY";
this.textY.Size = new System.Drawing.Size(83, 21);
this.textY.TabIndex = 3;
this.textY.Text = "";
//
// textX
//
this.textX.Location = new System.Drawing.Point(76, 46);
this.textX.Name = "textX";
this.textX.Size = new System.Drawing.Size(83, 21);
this.textX.TabIndex = 2;
this.textX.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(176, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 16);
this.label1.TabIndex = 0;
this.label1.Text = "纵比例 1:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 50);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(88, 16);
this.label3.TabIndex = 0;
this.label3.Text = "横比例 1:";
//
// FormOption
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(354, 120);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormOption";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "剖面图选项";
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void btnOK_Click(object sender, System.EventArgs e)
{
PublicValue.caption=textCaption.Text;
PublicValue.scaleX=float.Parse(textX.Text);
PublicValue.scaleY=float.Parse(textY.Text);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -