📄 frmtype.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace bggl.fm
{
/// <summary>
/// frmtype 的摘要说明。
/// </summary>
public class frmtype : System.Windows.Forms.Form
{
cs.frmTtype type=new bggl.cs.frmTtype();
DataSet objset=new DataSet();
TextBox first;
TextBox zz;
TextBox cc;
private System.Windows.Forms.DataGrid dataGrid1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmtype(TextBox ff,TextBox tb,TextBox cb)
{
first=ff;
zz=tb;
cc=cb;
//
// 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.dataGrid1 = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.DataMember = "";
this.dataGrid1.GridLineColor = System.Drawing.SystemColors.Desktop;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(0, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(240, 168);
this.dataGrid1.TabIndex = 0;
this.dataGrid1.DoubleClick += new System.EventHandler(this.dataGrid1_DoubleClick);
//
// frmtype
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(240, 168);
this.Controls.Add(this.dataGrid1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmtype";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "frmtype";
this.Load += new System.EventHandler(this.frmtype_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void frmtype_Load(object sender, System.EventArgs e) //显示数据表记录
{
try
{
objset=type.seltype();
this.dataGrid1.DataSource=objset.Tables["BG_CTtype"].DefaultView;
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void button1_Click(object sender, System.EventArgs e)
{
// int mm=this.dataGrid1.CurrentRowIndex;
// int wz=Convert.ToInt16(this.dataGrid1[mm,2].ToString());
}
private void dataGrid1_DoubleClick(object sender, System.EventArgs e) //传值
{
int mm=this.dataGrid1.CurrentRowIndex;
first.Text=this.dataGrid1[mm,0].ToString();
zz.Text=this.dataGrid1[mm,1].ToString();
cc.Text=this.dataGrid1[mm,2].ToString();
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -