摘要: 一、浅层拷贝,就是只拷贝类的第一层成员,而且如果成员是引用类型,则引用同一份。1、手动自己实现 class Person:ICloneable { public int Id { get; set; } public string Name { get; set; } public Dept Dept { get; set; } public object Clone() { Person person2 = new Person(); person2.Id = thi... 阅读全文
posted @ 2013-08-07 15:09 LS庆 阅读(647) 评论(0) 推荐(0) 编辑
摘要: 一、使用Control的SelectNextControl方法// 回车切换控件焦点//要想使这个方法起到作用先将窗体的keypreview属性改为trueprotected override void OnKeyPress(KeyPressEventArgs e){ // 判断是否按下回车键,13是Enter键的ASCII码值 if (e.KeyChar == 13) { // 激活下一个控件 this.SelectNextControl(this.ActiveControl, true, true, true, true); } ... 阅读全文
posted @ 2013-08-07 14:03 LS庆 阅读(411) 评论(0) 推荐(0) 编辑