摘要:
#region 窗体移动 [DllImport("user32.dll")] //需添加using System.Runtime.InteropServices public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); public const int WM_... 阅读全文
摘要:
//以下代码是从网上借鉴,并修改的,忘了那个人叫什么了。。不好意思。private int Combobox_Index_Num = -1;//datatgridview里需要添加的列是第几列private string Combobx_DSource_Name = "";//添加列的名字private ComboBox DataGridViewCombobox;//定义一个Comboboxpublic void DataSourceBing(){ Combobx_DSource_Name = "设备";//设备列变成combobox列Combobox_ 阅读全文
摘要:
datagridview的分页private int pagecount;private int pagecurrent;private int pagesize;private DataTable dt;private DataTable dt1;privateint ncurrent;//记录当前的行数private int nmax;//记录多少行public void Page_Load(object sender, EventArgs e){ DataTable datatable="数据库中查询出来的表";//有主键,方便下面的数据库的更新 dt=datatab 阅读全文
摘要:
datagridview的插入我用的在datatable的插入在刷新的方法var dt = new DataTable();DataRow drr = dt.NewRow();先把datagridview的数据取出来放在datatable里for (int i = 0; i < dataGridView1.Columns.Count; i++){dt.Columns.Add(dataGridView1.Columns[i].Name);}for (int j = 0; j < dataGridView1.Rows.Count; j++){DataRow dr = dt.NewRow 阅读全文