博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  winform 开发

摘要:http://www.cnblogs.com/peterzb/tag/WinForm/ 阅读全文

posted @ 2011-07-17 22:46 itcfj 阅读(161) 评论(0) 推荐(0)

摘要:在CheckBox改变值得时候,执行需要的业务。summary 我的做法是,将焦点转移出去,触发CellValueChanged事件 summary public partial class Form1 Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { CreateData(); } summary 绑定数据 summary private void CreateData() { DataTable dtSource = new Da 阅读全文

posted @ 2011-07-17 22:05 itcfj 阅读(1200) 评论(0) 推荐(0)

摘要:关于DataGridView绑定数据源后未设置的列不显示dataGridView.AutoGenerateColumns = false; 阅读全文

posted @ 2011-07-17 22:03 itcfj 阅读(243) 评论(0) 推荐(0)

摘要:源码:WebCast20070608am_Demo.zip 阅读全文

posted @ 2011-07-17 18:46 itcfj 阅读(142) 评论(0) 推荐(0)

摘要:效果图:代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace NotifyIconDemo{ public partial class Tray : Form { public Tray() { InitializeComponent(); } private void cToolStripMenuItem_C 阅读全文

posted @ 2011-07-17 18:40 itcfj 阅读(255) 评论(0) 推荐(0)

摘要:源码:WebCast20070608am_Demo.zip 效果:Form2 制作不规则窗体:Form2:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace MSNMessageForm{ public partial class Form2 : Form { private int heightMax, widt 阅读全文

posted @ 2011-07-17 18:27 itcfj 阅读(167) 评论(0) 推荐(0)

摘要:以前对WinForm窗体显示和窗体间传值了解不是很清楚最近做了一些WinForm开发,把用到的相关知识整理如下A.WinForm中窗体显示显示窗体可以有以下2种方法:Form.ShowDialog方法 (窗体显示为模式窗体)Form.Show方法 (窗体显示为无模式窗体)2者具体区别如下:1.在调用Form.Show方法后,Show方法后面的代码会立即执行2.在调用Form.ShowDialog方法后,直到关闭对话框后,才执行此方法后面的代码3.当窗体显示为模式窗体时,单击“关闭”按钮会隐藏窗体,并将DialogResult属性设置为DialogResult.Cancel 与无模式窗体不同,当 阅读全文

posted @ 2011-07-17 18:15 itcfj 阅读(174) 评论(0) 推荐(0)

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Threading;using System.Windows.Forms;using System.Xml;namespace UseBackgroundWorker{ public partial class Form1 : Form { private XmlDocument document = null; public Form1() { InitializeCompone 阅读全文

posted @ 2011-07-17 18:12 itcfj 阅读(203) 评论(0) 推荐(0)

摘要:源码:WebCast20070601_Demo.zipusing System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.IO;//添加引用,以使用文件和目录类namespace ListView_TreeView{ /// <summary> /// 使用Treeview和ListView示例,产生和Windows资源管理器效果 /// </summary 阅读全文

posted @ 2011-07-17 18:10 itcfj 阅读(735) 评论(0) 推荐(0)

摘要:源码:WebCast20070601_Demo.zip //---------------------------------------------------------------------// This file is part of the Microsoft .NET Framework SDK Code Samples.// // Copyright (C) Microsoft Corporation. All rights reserved.// //This source code is intended only as a supplement to Microsoft/ 阅读全文

posted @ 2011-07-17 18:05 itcfj 阅读(660) 评论(0) 推荐(0)

摘要:把多个radioButton 放在同一个容器中using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace RadioButtonDemo{ public partial class Form1 : Form { private Color curColor; public Form1() { InitializeCompo 阅读全文

posted @ 2011-07-17 17:57 itcfj 阅读(220) 评论(0) 推荐(0)

摘要:方法一:把Form1 的属性设为位图:BackPic.bmp,using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace IrregularForm{ public partial class Form1 : Form { private Point mouseOffset; private bool isMouseDow 阅读全文

posted @ 2011-07-17 17:38 itcfj 阅读(223) 评论(0) 推荐(0)

摘要:本页内容概述组件介绍应用示例实现原理结束语概述在应用程序中,可能会遇到一些执行耗时的功能操作,比如数据下载、复杂计算及数据库事务等,一般这样的功能会在单独的线程上实现,执行结束后结果显示到用户界面上,这样可避免造成用户界面长时间无响应情况。在.NET 2.0及以后的版本中,FCL提供了BackgroundWorker组件来方便的实现这些功能要求。组件介绍BackgroundWorker类位于System.ComponentModel 命名空间中,通过该类在单独的线程上执行操作实现基于事件的异步模式。下面对BackgroundWorker类的主要成员进行介绍。BackgroundWorker类的 阅读全文

posted @ 2011-07-12 09:56 itcfj 阅读(268) 评论(0) 推荐(0)