
c#学习笔记
yw1688
这个作者很懒,什么都没留下…
展开
-
c#不规则窗体之移动窗体
using System;using System.Drawing;using System.Windows.Forms;namespace 不规则窗体{ public partial class Form1 : Form { public Form1() { InitializeComponent();原创 2012-10-26 15:45:24 · 493 阅读 · 0 评论 -
ListView中加复选框并实现全选(全不选)
using System;using System.Windows.Forms;using System.IO;namespace 带复选框的ListView{ public partial class Form1 : Form { public Form1() { InitializeComponent();原创 2012-11-16 16:50:33 · 1696 阅读 · 0 评论 -
DataGridView合并单元格
using System;using System.Drawing;using System.Windows.Forms;namespace 合并DataGridView单元格{ public partial class Form1 : Form { public Form1() { InitializeCompon原创 2012-11-19 10:19:23 · 773 阅读 · 0 评论 -
在按钮上绘制图片
using System;using System.Drawing;using System.Windows.Forms;namespace 在button上绘制图片{ public partial class Form1 : Form { public Form1() { InitializeComponent()原创 2012-11-19 17:13:14 · 399 阅读 · 0 评论 -
动态改变TextBox的背景色
private void textBox1_Enter(object sender, EventArgs e) { ((TextBox)sender).BackColor = Color.LightCoral; } private void textBox1_Leave(object sender, EventArgs e)原创 2012-11-19 16:51:36 · 1233 阅读 · 0 评论 -
vs2008发布失败完美解决方案
最近用vs2008发布自己的项目,老提示失败,但找不到失败的原因!怎一个郁闷了得!呵呵!百度,google查询了一下,终于在一个外国网站找到了答案!难道就只有老外才是正宗吗!!!????解决方法:要想知道发布是怎么失败的,一个组合键搞定ctrl+alt+o仔细查看信息你会发现有没发布成功的详细提示,下一步要做的就是在资源管理器中找到那一项(可能多个项),删除或排除到项目外,转载 2012-12-03 22:22:29 · 429 阅读 · 0 评论 -
c#后台设置某些关键字高亮
/// 高亮显示关键字,保持内容的大小写一致 /// /// /// protected string GetRedWord(string key) { string skey = Request.QueryString["key"]; if (string.IsN原创 2012-12-07 23:13:54 · 1053 阅读 · 0 评论 -
Dynamic 动态类型 和双问号??的使用
1.dynamic关键字用于声明一个动态对象,然后通过该动态对象去调用方法或读写属性。以前我们都是在运行时通过反射,Emit,CodeDom等技术来完成。创建一个dynamic类型的对象需要使用一个特殊的构建器叫ExpandoObject。 dynamic aehyok = new ExpandoObject(); aehyok.Name =转载 2012-12-10 09:00:24 · 493 阅读 · 0 评论 -
BackgroundWorker组件的使用
using System;using System.ComponentModel;using System.Windows.Forms;namespace BackGroundWorker组件{ public partial class Form1 : Form { public Form1() { Initiali原创 2012-12-18 16:35:15 · 498 阅读 · 0 评论 -
RichTextBox中用指定字体和颜色高亮显示指定字符
using System;using System.Windows.Forms;using System.Text.RegularExpressions;namespace RichTextBox描红指定内容{ public partial class Form1 : Form { public Form1() { I原创 2012-11-15 15:34:20 · 2085 阅读 · 1 评论 -
ListView创建列和设置数据并保存成xml
using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.IO;using System.Xml;namespace ListView控件中实现修改{ public partial class Form1 : Form原创 2012-11-16 11:47:06 · 1094 阅读 · 0 评论 -
ListView控件间的数据移动
using System;using System.Windows.Forms;namespace listview控件应用{ public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Loa原创 2012-11-16 10:43:49 · 469 阅读 · 0 评论 -
美化ComboBox下拉
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace 美化com原创 2012-11-14 17:48:41 · 2665 阅读 · 0 评论 -
点击RichTextBox中的链接,在默认浏览器中打开网页
using System.Windows.Forms;using System.Diagnostics;using System;namespace RichTextBox中加超链接文字{ public partial class Form1 : Form { public Form1() { InitializeCo原创 2012-11-15 09:33:39 · 818 阅读 · 0 评论 -
c#中filedialog文件格式限制
在C#中,OpenFileDialog和SaveFileDialog的filter属性,如果想并列有多个格式,可以多个格式用 ; 隔开如:OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "RTF文件|*.rtf;*.doc|所有文件|*.*"; ofd.InitialDirect原创 2012-11-15 13:21:00 · 3220 阅读 · 0 评论 -
winform给TextBox加一个下划线
using System.Drawing;using System.Runtime.InteropServices;using System;using System.Windows.Forms;namespace TextBox控件底端显示下划线{ public partial class CustomTextBoxGroup:System.Windows.Forms.TextB原创 2012-11-14 16:05:24 · 4092 阅读 · 1 评论 -
用ComboBox制作浏览器输入框效果
using System;using System.Windows.Forms;namespace ComboBox下拉控件做浏览器网址输出框{ public partial class Form1 : Form { public Form1() { InitializeComponent();原创 2012-11-15 09:50:12 · 656 阅读 · 0 评论 -
c#中读写rtf文件
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;原创 2012-11-15 13:32:20 · 6766 阅读 · 0 评论 -
C# CHECKEDLISTBOX控件用法总结(怎样得到多选的值)
一般认为:foreach (object obj in checkedListBox1.SelectedItems)即可遍历选中的值。其实这里遍历的只是高亮的值并不是打勾的值。遍历打勾的值要用下面的代码:for (int i = 0; i { if (checkedListBox1.GetItemChecked(i)) { MessageB转载 2012-11-15 16:38:08 · 634 阅读 · 0 评论 -
winform中为CheckedListBox绑定数据
CheckedListBox一样有DataSource、DisplayMember和ValueMember属性的,只是IntelliSense不能将其智能感知出来.我们可以不理它的智能提示,自己写就可以了,只要写对了,编译也是不会报错的。using System;using System.Collections.Generic;using System.Windows.Forms;原创 2012-11-15 17:01:06 · 1416 阅读 · 0 评论 -
Process组件的使用
using System;using System.Diagnostics;using System.Windows.Forms;namespace Process组件{ public partial class Form1 : Form { public Form1() { InitializeComponent(原创 2013-01-17 15:06:13 · 700 阅读 · 0 评论