随笔分类 - C#
摘要:private void DGV_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex >= 0 && DGV.Columns[e.ColumnIndex].Name == "字段名称
阅读全文
摘要:Microsoft Visual C++ Runtime Library Debug Assertion Failed! Program: ...ware_demo_c++_2021-09-25\PCSoftware_demo\Debug\PCSoftware.exeFile: minkernel\
阅读全文
摘要:最常见的ProcessStartInfo启动 ProcessStartInfo info = new ProcessStartInfo(); info.FileName = @"路径\exe的文件名"; info.Arguments = ""; info.WindowStyle = ProcessW
阅读全文
摘要:System.InvalidOperationException:“在 ServiceModel 客户端配置部分中,找不到引用协定“olding_interface.odingValueServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协
阅读全文
摘要:c#tableLayoutPanel 上下行无法拖动变宽窄解决方法 选中后编辑行和列--选择行--如果选择的《绝对》,就无法改变。可选择设置百分比或者自动调整大小(根据放入的控件大小,控件拖大小,tableLayout行随之改变) 翻译 搜索 复制
阅读全文
摘要:C#实现外部图片的拖拽拖入图片框 pictureBox1的属性里面直接选择是找不到的,只能代码设置 拖入到picturebox上面: //这句代码不会抱错,但是需要手动输入,.net编辑器无法自动识别AllowDrop this.pictureBox1.AllowDrop = true; priva
阅读全文
摘要:C#的Dev中GridControl_gridview新增添加数据 DataTable dt = gridControl1.DataSource as DataTable; string equ_id = comboBoxEdit_add_equ_link_id.Text; string stock
阅读全文
摘要:C#的Dev中GridControl_gridview选中一行删除与读取数据 1.获取GridControl工具选中一行数据的写法1 //GridView:对应GridControl工具中GridView修改名字int handle = gridView_equ_relation.FocusedRo
阅读全文
摘要:C# winform DataGridView删除指定行 int a = dataGridView1.SelectedRows.Index; DataGridViewRow row = dataGridView1.Rows[a]; dataGridView1.Rows.Remove(row); Da
阅读全文
摘要:C# DataGridView如何获取选中行/列的某个数据 DataGridView的几个基本操作:1、获得某个(指定的)单元格的值:dataGridView1.Row[i].Cells[j].Value;2、获得选中的总行数:dataGridView1.SelectedRows.Count;3、获
阅读全文
摘要:c# winform获取gridview数据 //取单元格数据三种方法 this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();//第一种取法 this.dataGridView1.Rows[e.RowIndex].Cells["
阅读全文
摘要:c#时间相减时分秒 两种日期格式 yyyyMMddHHmmss、yyyy-MM-dd HH:mm:ss string date1 = DateTime.Now.ToString("yyyyMMddHHmmss"); string date2 = DateTime.Now.AddHours(1).To
阅读全文
摘要:更新控件,显示到最新位置,屏蔽 this.richTextBox_system_log.Focus();避免其它窗口打开时,此窗口被激活 private void AddToMainWindowLog(string str) { string str_to_file = str; str = CFi
阅读全文
摘要:C# 对象的深复制拷贝和浅复制拷贝 参考:https://www.cnblogs.com/Ivan-Wu/p/10311309.html Queue<string> aa = new Queue<string> { }; Queue<string> bb = new Queue<string> {
阅读全文
摘要:3、从右边开始取i个字符: string str1=str.SubString(str.Length-i); string str1=str.Remove(0,str.Length-i); String.SubString(int index,int length)index:开始位置,从0开始le
阅读全文
摘要:C#程序编译时自动更新版本号方法 严重性 代码 说明 项目 文件 行 禁止显示状态错误 命令“AutoUpdateVersion D:\tt666\Wafxxxnspection20230118\Waferxxxspection\WaferSawxxxction\Properties\Assembl
阅读全文
摘要:C#遍历字典Dictionary List<string> list_key = new List<string>(); foreach (var str_value in dictionary_mc_agv_name) { if (str_value.Value == "JIAZHI2") { l
阅读全文
摘要:c# 字典dictionary 1个key键对应多个值得方法-MultiDictionary c# 字典dictionary查找是否包含 Dictionary<string, List<string>> multi_dic = new Dictionary<string, List<string>>
阅读全文