📄 frmybjg.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace DataC
{
/// <summary>
/// Summary description for frmYBJG.
/// </summary>
struct DragData
{
public string m_strTableName;
public string m_strFieldName;
public string m_strFieldType;
}
public class frmYBJG : System.Windows.Forms.Form
{
public
string strTableName=null;
ArrayList _alFieldList=null;
public System.Windows.Forms.ListBox lbZD;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public frmYBJG(string strtn,ArrayList alfieldlist)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
strTableName=strtn;
this.Text="表名:"+strTableName;
_alFieldList=alfieldlist;
}
/// <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.lbZD = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// lbZD
//
this.lbZD.AllowDrop = true;
this.lbZD.ItemHeight = 12;
this.lbZD.Location = new System.Drawing.Point(0, 0);
this.lbZD.Name = "lbZD";
this.lbZD.Size = new System.Drawing.Size(115, 172);
this.lbZD.TabIndex = 0;
this.lbZD.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbZD_MouseDown);
//
// frmYBJG
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(115, 172);
this.Controls.Add(this.lbZD);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmYBJG";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Load += new System.EventHandler(this.frmYBJG_Load);
this.ResumeLayout(false);
}
#endregion
private void frmYBJG_Load(object sender, System.EventArgs e)
{
System.Collections.IEnumerator myEnumerator = _alFieldList.GetEnumerator();
while(myEnumerator.MoveNext())
{
lbZD.Items.Add(myEnumerator.Current.ToString());
}
}
private void lbZD_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
DragData data;
data.m_strTableName = this.strTableName;
data.m_strFieldName = lbZD.Items[lbZD.SelectedIndex].ToString();
data.m_strFieldType =null;
lbZD.DoDragDrop(data, DragDropEffects.Copy);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -