
winform开发
winform开发
碧山云游
Life sometimes is boring,so i sometimes do some boring thing to avoid it
展开
-
winform防闪屏写法
SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景. SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲原创 2021-07-02 16:49:22 · 148 阅读 · 0 评论 -
WINFORM跨线程访问控件
//通过跨线程给控件赋值 private void btnExecute1_Click(object sender, EventArgs e) { Thread thread = new Thread(() => { for (int i = 0; i < 10; i++) { // this.lblR..原创 2021-01-13 09:04:52 · 215 阅读 · 0 评论 -
winform中ComboBox下拉框控件的动态数据填充
private System.Windows.Forms.ComboBox cboClass; //始化班级下拉框 this.cboClass.DataSource = objClassService.GetAllClass(); this.cboClass.DisplayMember = "ClassName";//设置下拉框显示文本 this.cboClass.ValueMember = "ClassId";/...原创 2020-12-27 21:43:35 · 2091 阅读 · 5 评论 -
winform中的datagridview绑定到list上,并实现升序和降序
#region 实现降序排序 class NameDESC : IComparer<Student> { public int Compare(Student x, Student y) { return y.StudentName.CompareTo(x.StudentName); } } class StudentDESC : IComparer<Student> .原创 2020-12-27 21:38:21 · 698 阅读 · 0 评论 -
Winform程序子窗体嵌入到父窗体中
#region 嵌入窗体显示 private void CloseForm() { //遍历spContainer.Panel2中的控件,如果存夺Form控件,则将它关闭。 foreach (Control item in this.spContainer.Panel2.Controls) { if (item is Form)//如果是Form控件,就将它关闭掉 ...原创 2020-12-27 21:23:54 · 1939 阅读 · 0 评论