随笔分类 - [02] C#/VB.NET
用于开发Windows应用程序以及网页/网站。
摘要:C# WinForm开发系列 - Open-Source Controls 整理了一些在WinForm开发中可以使用的开源组件.(文章及相关代码搜集自网络,仅供学习参考,版权属于原作者! ). 1. 仿office 2007的Ribbon风格面板(该控件模仿office 2007的Ribbon风格,显示操作面板。) 2. .NET中最全功能的表格控件 [翻...
阅读全文
摘要: Add, Edit, and Delete in DataGridView with Paging http://www.codeproject.com/KB/grid/DataGridView_manipulation.aspx 4.45 out of 5 DataGridView paging using virtual mode http://b...
阅读全文
摘要:通过继承系统的ComboBox,写一个新控件ComboBoxEx,重写它的焦点以及文本更新事件,就可以轻松实现拼音首字母检索了。例如:输入 gd ,就可以出现“广东”。 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 using System.Windows.Forms; 5 using Syst...
阅读全文
摘要:方法一: private void dgv_zy_CellContentClick(object sender, DataGridViewCellEventArgs e) { int count = Convert.ToInt16(dgv_zy.Rows.Count...
阅读全文
摘要:项目中需要一个这样的DataGridView(字段不同): 1. DataSource绑定到一个DataTable上,这里假设DataTable有两个字段:ID, Name。 2. 第一列为CheckBox,让用户来选,提交的时候就提交CheckBox选中的。 我开始的时候是先在DataGridView初始化的时候就加入一列CheckBox,然后再把DataS...
阅读全文
摘要:今天在winform下使用DataGridView时,使用了checkbox列。一般我们可以通过一个按钮的单击事件中,来判断该列是否被选中。但这样似乎不太人性化。因此改为当checkbox被选中时,执行任务。 可别小看了这个问题。我试了很多的datagridview事件,比如 cellClick CellContentChanged 等事件,要不就是无法扑捉,要不就是得到的值为选中前的值:fals...
阅读全文
摘要:Question: datagridview里有一列checkbox,为何单击选中不了它,也就是打不上勾.不知为何啊,请大家帮帮忙 Code Snippet // chkId ...
阅读全文
摘要:C# 访问 Microsoft Access 数据库的特殊处理 以下使用参数访问数据库失败: public static bool Update( int aA用户编号, ...
阅读全文
摘要:写在前面:如果大家觉得.Net自带的GroupBox控件太差了,样子很不美观,而想用.Net强大的自定义功能来实现定制控件,如,在GroupBox的Title那里加个Button形状的东西,给GroupBox的四周的角都变成圆的,给GroupBox加个背景色,并且有过渡效果。那,请您看看,下面的效果图,是不是您所需要的?就是不是你需要的,但是不是有很大的参考价值?应该是吧。 介绍此自定义控件的源网...
阅读全文
摘要:写在前面:.Net自带有标准的控件Tooltip,但是,在使用过程中,也有不合人意的时候,如自动关闭的问题,或怎样关闭提示,提示显示多长时间的问题。下面介绍一个比较好用的Tooltip自定义控件Message Balloon,通过对些控件的一些简单的介绍,希望大家可以找到自已喜欢的Tooltip控件。 介绍这一款控件的源网址是:http://www.codeproject.com/KB/shell...
阅读全文
摘要:Solution 1: 不想用绑定的话,自已写一个实现Value和Text属性的类,然后重写ToString()方法,并返回和Text属性一样的值,然后把这个类的实际Add到ComboBox.Items中,取值时再转换一下类型. 当你往ComboxBox的Item中扔一个任意object时,显示出的内容就是这个object的ToString()方法.所以必须...
阅读全文
摘要:Windows Form Data Validation http://www.codeproject.com/KB/validation/validationprovider.aspx (Great: Validators for Windows Forms - ValidationProvider Control , Score: 4.4/5) http:/...
阅读全文
摘要: iText# (iTextSharp) is a port of the iText open source java library written entirely in C# for the .NET platform. iText# is a library that allows you to generate PDF files on the fly. It is im...
阅读全文
摘要:public class XmlControl { protected string strXmlFile; protected XmlDocument objXmlDoc = new XmlDocument(); public XmlControl(string XmlFile) { // // TODO: 在这里加入建构函式的程序代码 // try { objXmlDoc.Load(XmlFi...
阅读全文
摘要:.Net 框架目前逐步在普及了,仍然有很多人在寻找如何让.NET程序脱离.NET框架的方法。 现成的工具有 Xenocode 的postbuidle或者vas,还有 Salamander .NET Linker . 另外还有 MaxToCode 作者以前做的 framework linker. 以及一些支持注册表模拟和文件模拟的打包工具molebox,thinstall等. 最后...
阅读全文
摘要:So I have a .NET COM .dll server and I would like to distribute it to any platform (64-bit or 32-bit) to be used by any client (32-bit or 64-bit, particularly). I probably am going to package the .dll...
阅读全文
摘要:用System.Net.Mail发送邮件时错误信息 配置示例如下: 配置错误及提示信息: SmtpServer错误: Unable to connect to the remote server Port错误: Un...
阅读全文
摘要:Log4net: use Sql Server to log your application events by Emanuele 2/23/2008 2:26:00 PM In the previous article on the Log4net configuration, I explain how to configure Log4net with the file appende...
阅读全文
摘要:C#日期格式化 from: http://51xingfu.blog.51cto.com/219185/46222 日期转化一 为了达到不同的显示效果有时,我们需要对时间进行转化,默认格式为:2007-01-03 14:33:34 ,要转化为其他格式,要用到DateTime.ToString的方法(String, IFormatProvider),如下所示: using System; u...
阅读全文
摘要:正则表达式30分钟入门教程 from: http://www.unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm 版本:v2.21 (2007-8-3) 作者:deerchao 来源:unibetter大学生社区 转载请注明来源 目录 本文目标 如何使用本教程 正则表达式到底是什么? 入门 ...
阅读全文