摘要: [C#] winform中的DataGridView的列宽设置(自动调整列宽) 找了很多都说DataGridView有一个属性AutoSizeColumnMode,他有很多枚举值: 1、AllCells 调整列宽,以适合该列中的所有单元格的内容,包括标题单元格。 2、AllCellsExceptHe 阅读全文
posted @ 2020-06-27 09:59 向前追起 阅读(9611) 评论(0) 推荐(0)
摘要: 1、首先要在listview控件属性中,添加click事件 2、要判断是否获取了几行int selectCount = listview1.SelectedItems.Count; //选中的行数目,listview1是控件名。if (selectCount == 0) return;//没选中,不 阅读全文
posted @ 2020-06-22 10:51 向前追起 阅读(1184) 评论(0) 推荐(0)
摘要: 设置光标在最后 memoEdit1.SelectionStart = memoEdit1.Text.Length; memoEdit1.ScrollToCaret(); 阅读全文
posted @ 2020-05-26 18:48 向前追起 阅读(1310) 评论(1) 推荐(0)
摘要: 1.BindingSource组件是数据百源和控件间的一座桥,同时提供了大量的API和Event供我们使用度;版使用这些API可以将Code与各种具体类型数据权源进行解耦;使用这些Event可以洞察数据的变化。2.简单绑定用法:DataTable myTable = myTableAdapter.G 阅读全文
posted @ 2020-05-21 18:49 向前追起 阅读(234) 评论(0) 推荐(0)
摘要: public class ZipBin { public byte[] bytes; //C#读取压缩文件(将压缩文件转换为二进制 public void GetZipToByte(string inpath) { FileStream fs = new FileStream(inpath, Fil 阅读全文
posted @ 2020-05-07 19:35 向前追起 阅读(706) 评论(0) 推荐(0)
摘要: SqlParameter[] SqlPar = {new SqlParameter("@OrgID", orgid),new SqlParameter("@Count", SqlDbType.Int, 12)}; SqlPar[1].Direction = ParameterDirection.Ou 阅读全文
posted @ 2020-04-17 11:52 向前追起 阅读(531) 评论(0) 推荐(0)
摘要: this.dataGridView.Rows.Clear(); 阅读全文
posted @ 2020-03-23 16:21 向前追起 阅读(3699) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; using System.Con 阅读全文
posted @ 2020-03-21 10:08 向前追起 阅读(353) 评论(0) 推荐(0)
摘要: 用SQLParameter来对变量参数化 private string connString = ConfigurationManager.ConnectionStrings["TestConnectString"].ToString(); public UserLogin UserLogin(Us 阅读全文
posted @ 2020-03-21 10:07 向前追起 阅读(948) 评论(0) 推荐(0)
摘要: C# private void InsertMultiBoardBarcodeRec() { //判断列表数据不能为空..... if (dataGridView1.RowCount==0) { MessageBox.Show("打印列表行为空,请获取拼板SN...", "提示窗口...."); r 阅读全文
posted @ 2020-03-19 19:56 向前追起 阅读(1247) 评论(0) 推荐(0)