随笔分类 - winform
摘要:1.自定义控件, 和接口 interface IModify { bool IsModified { get; } } class TextBoxEx : TextBox, IModify { private bool isModified = false; public bool IsModified { get { return isModified; } } protected override void OnTextChanged(EventArgs ...
阅读全文
摘要:private void treeView1_AfterCheck(object sender, TreeViewEventArgs e){ if (e.Action != TreeViewAction.ByMouse) return; SetParentNode(e.Node); SetChildNode(e.Node);}private void SetParentNode(TreeNode node){ if (node.Level > 0) { node.Parent.Checked = true; SetParentNode(node.Parent); }}private vo
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication3{ public partial class Form3 : Form { public Form3() { InitializeComponent(); } public struct ComboBoxItem&l
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication3{ public partial class Form2 : Form { public Form2() { InitializeComponent(); this.comboBox1.DropDownStyle =
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication3{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } class User { public int id {
阅读全文
摘要:通过重写 ProcessCmdKey 方法 <!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br /
阅读全文