摘要: 在Window中设置 位于界面中心 1 WindowStartupLocation="CenterScreen" 位于最前面 1 Topmost="True" 阅读全文
posted @ 2020-11-24 11:12 llkj 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1 private int SubstringCount(string str, string a) 2 { 3 int count = 0; 4 if (str.Contains(a)) 5 { 6 string s = str.Replace(a, ""); 7 count = str.Leng 阅读全文
posted @ 2020-11-24 10:31 llkj 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 方法:递归 数据结构:队列 输入:要删除的最高级别的项 利用递归的方法,迭代查找要删除的项 是否满足 其子项也被删除或无子项, 满足则入队列,否则将队列置为空,逐层返回。 阅读全文
posted @ 2020-11-23 17:08 llkj 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1 <Style x:Key="ControlBtnStyle" TargetType="{x:Type Button}"> 2 <Setter Property="Template"> 3 <Setter.Value> 4 <ControlTemplate TargetType="{x:Type 阅读全文
posted @ 2020-11-16 17:41 llkj 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 原因一: cs 文件中 赋值时没有将 ItemsSource 置为 null 原因二:(多数情况是这个原因导致的错误) xml 代码出现问题。 仔细检查对应控件 那部分的代码, 一般是缺少必要的嵌套。 <DataGrid> <Style> ... </Style> </DataGrid> 这样的代码 阅读全文
posted @ 2020-11-07 17:24 llkj 阅读(4637) 评论(0) 推荐(0) 编辑
摘要: 1 public class People 2 { 3 public string Name; 4 public DataTime Birthday; 5 public string Tel; 6 } 7 8 List<People> peopleList = new List<People>(); 阅读全文
posted @ 2020-11-07 10:25 llkj 阅读(2454) 评论(0) 推荐(0) 编辑
摘要: 方法一: 不新增列,利用最左侧列。 首先, 为DataGrid添加LoadingRow事件: 1 this.dataGridEquipment.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.dataGridEquipment_Lo 阅读全文
posted @ 2020-11-05 09:23 llkj 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 去掉最左侧一小列 在定义DataGrid时 添加一个属性设置即可 RowHeaderWidth=“0” 添加以后的界面如下图所示: 阅读全文
posted @ 2020-11-05 09:09 llkj 阅读(663) 评论(0) 推荐(0) 编辑
摘要: public byte[] IntToByteArray(int src, int length) { byte[] b = new byte[length]; for (int i = 0; i < length; i++) { b[length - i - 1] = (byte)((src >> 阅读全文
posted @ 2020-10-30 17:24 llkj 阅读(201) 评论(0) 推荐(0) 编辑
摘要: byte数组转换为int byte[] bytes = {0xff, 0xff}; int num = BitConverter.ToInt32(bytes, 0); // 0为字节数组开始转换的起始位置下标 int 转换为 byte数组 int num = 3; byte[] bytes = Bi 阅读全文
posted @ 2020-10-30 17:05 llkj 阅读(2095) 评论(0) 推荐(0) 编辑