?? expendinfotexteditorform.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Yinde.Cnc.PageLister
{
/// <summary>
/// 擴展信息文本編輯器。
/// </summary>
public class ExpendInfoTextEditorForm : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtExpendInfoText;
private System.Windows.Forms.Button btnAccept;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.ListBox lstItem;
private System.Windows.Forms.Label lblView;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
/// <summary>
/// 擴展信息文本編輯器。
/// </summary>
public ExpendInfoTextEditorForm()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//
// 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.txtExpendInfoText = new System.Windows.Forms.TextBox();
this.btnAccept = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.lblView = new System.Windows.Forms.Label();
this.lstItem = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// txtExpendInfoText
//
this.txtExpendInfoText.Location = new System.Drawing.Point(16, 8);
this.txtExpendInfoText.Name = "txtExpendInfoText";
this.txtExpendInfoText.Size = new System.Drawing.Size(376, 21);
this.txtExpendInfoText.TabIndex = 0;
this.txtExpendInfoText.Text = "";
this.txtExpendInfoText.TextChanged += new System.EventHandler(this.txtExpendInfoText_TextChanged);
//
// btnAccept
//
this.btnAccept.Location = new System.Drawing.Point(312, 120);
this.btnAccept.Name = "btnAccept";
this.btnAccept.TabIndex = 1;
this.btnAccept.Text = "確定";
this.btnAccept.Click += new System.EventHandler(this.btnAccept_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(312, 88);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "取消";
//
// lblView
//
this.lblView.Location = new System.Drawing.Point(16, 40);
this.lblView.Name = "lblView";
this.lblView.Size = new System.Drawing.Size(376, 16);
this.lblView.TabIndex = 3;
//
// lstItem
//
this.lstItem.ItemHeight = 12;
this.lstItem.Items.AddRange(new object[] {
"頁索引 \t\tPageIndex",
"起始記錄索引\tRecordStartIndex",
"結束記錄索引\tRecordEndIndex",
"記錄集總頁數\tPageCount",
"記錄集總數\tRecordCount",
"單頁顯示記錄數\tPageSize"});
this.lstItem.Location = new System.Drawing.Point(16, 72);
this.lstItem.Name = "lstItem";
this.lstItem.Size = new System.Drawing.Size(280, 76);
this.lstItem.TabIndex = 4;
this.lstItem.DoubleClick += new System.EventHandler(this.lstItem_DoubleClick);
//
// ExpendInfoTextEditorForm
//
this.AcceptButton = this.btnAccept;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(402, 159);
this.Controls.Add(this.lstItem);
this.Controls.Add(this.lblView);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnAccept);
this.Controls.Add(this.txtExpendInfoText);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExpendInfoTextEditorForm";
this.Text = "擴展信息文本編輯器";
this.ResumeLayout(false);
}
#endregion
private void txtExpendInfoText_TextChanged(object sender, System.EventArgs e)
{
try
{
lblView.Text=String.Format(this.txtExpendInfoText.Text,"2","11","20","23","225","10");
}
catch
{
lblView.Text="格式有誤,無法轉換";
}
}
private void lstItem_DoubleClick(object sender, System.EventArgs e)
{
txtExpendInfoText.Text+= "{" + lstItem.SelectedIndex + "}";
txtExpendInfoText.Focus();
txtExpendInfoText.SelectionStart=txtExpendInfoText.Text.Length;
}
private void btnAccept_Click(object sender, System.EventArgs e)
{
if(lblView.Text!="格式有誤,無法轉換")
{
DialogResult=DialogResult.OK;
Close();
}
}
/// <summary>
/// 設置或獲得 ExpendInfoText 屬性值
/// </summary>
public string Value
{
get
{
return txtExpendInfoText.Text;
}
set
{
txtExpendInfoText.Text=value;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -