文章分类 -  C#.NET

上一页 1 2 3 4 5 6 7 8 9 下一页
C# DataGirdView添加空行
摘要:1.没有绑定数据源DataGirdView1.Rows.Add(); 添加一行(空行)还可以这样:DataGirdView1.Rows.Add(3); 添加3行(空行)2.绑定了数据源绑定了数据源就不能使用方法1,不然报错。可使用下面的方法if (dgProLine.CurrentRow.Ind... 阅读全文
posted @ 2014-08-07 16:21 清风暮雨 阅读(1050) 评论(0) 推荐(0)
DevExpress的GridControl的实时加载数据解决方案(取代分页)和WinForm程序虚拟分页(实时加载数据)
摘要:DevExpress的GridControl的实时加载数据解决方案(取代分页)详情:http://www.cnblogs.com/liulun/archive/2009/10/17/1585061.htmlWinForm程序虚拟分页(实时加载数据)详情:http://www.cnblogs.com/... 阅读全文
posted @ 2014-08-07 11:47 清风暮雨 阅读(298) 评论(0) 推荐(0)
c#判断picturebox中是否有图片
摘要:if (pictureBox.Image != null) { //有图片 } else { //无图片 } 或 if (pictureBox.ImageLocation!= null) { //有图片路径 } else { /... 阅读全文
posted @ 2014-07-22 16:21 清风暮雨 阅读(911) 评论(0) 推荐(0)
C# 获取图片的缩略图
摘要:方法1.public bool ThumbnailCallback(){ return false;}public void Example_GetThumb(PaintEventArgs e){ Image.GetThumbnailImageAbort myCallback = ... 阅读全文
posted @ 2014-07-22 14:15 清风暮雨 阅读(1502) 评论(0) 推荐(0)
C# 修改DataGridView列高和列宽
摘要:this.dgvParent.Columns["Pic"].Width = 200; //列宽this.dgvParent.RowTemplate.Height = 100; //列高datagridview.backgroundcolor //背景 // 禁止用户改变Data... 阅读全文
posted @ 2014-07-21 14:56 清风暮雨 阅读(1147) 评论(0) 推荐(0)
C# 自定义DataGridView列
摘要:1.定义using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Drawing;using System.Windows.Forms;using System.Col... 阅读全文
posted @ 2014-07-21 14:46 清风暮雨 阅读(11858) 评论(1) 推荐(0)
C# 把图片直接存进数据库和显示图片
摘要:1.选择图片#region 选择图片 private void btPic_Click(object sender, EventArgs e) { try { string pathName; ... 阅读全文
posted @ 2014-07-21 11:07 清风暮雨 阅读(378) 评论(0) 推荐(0)
DataGridView中设置列高自动调整
摘要:private void dgvParent_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { this.dgvParent.AutoSizeColumnsMode = DataG... 阅读全文
posted @ 2014-07-21 10:22 清风暮雨 阅读(428) 评论(0) 推荐(0)
C# 选择弹框中DatatGridView的内容并返回该内容
摘要:1.DataGridView所在的窗体//变量 public delegate void GetDgRow(DataGridViewSelectedRowCollection rows); public virtual event GetDgRow EventShowRo... 阅读全文
posted @ 2014-07-16 15:24 清风暮雨 阅读(265) 评论(0) 推荐(0)
线程间操作无效: 从不是创建控件“FrmProgressForm”的线程访问它。
摘要:问题原因是。net2.0以后拒绝多线程访问空间,避免空间造成死锁。以前Control.CheckForIllegalCrossThreadCalls =false;默认就是这样,现在默认为true。如果不会好几个线程同时操作一个控件用方法1就可以。如果存在多个线程一起操作控件使用方法21.在默认构造... 阅读全文
posted @ 2014-07-15 15:30 清风暮雨 阅读(362) 评论(0) 推荐(0)
ConfigurationManager.AppSettings["....."]语句的作用
摘要:ConfigurationManager.AppSettings["DAL"]意思是指从web.config(或者App.config)配置文件中获取key值为“DAL”的Value例如:private static readonly string path = ConfigurationManag... 阅读全文
posted @ 2014-07-15 11:34 清风暮雨 阅读(2095) 评论(0) 推荐(0)
C#上传图片到服务器
摘要:http://zhidao.baidu.com/link?url=syLQP4oTYAJSIeN6AtN0ErhAJabBLWDiPcGdD8-0_t_NpEDsVKFUJ_8mcsoK5-NKBN4v0jOX30kicINHJYvG8Khttp://zhidao.baidu.com/link?ur... 阅读全文
posted @ 2014-07-04 15:23 清风暮雨 阅读(532) 评论(0) 推荐(0)
C# 获取机器序列号
摘要:using System;using System.Linq;using System.Collections.Generic;using System.Text;using System.IO;using System.Windows.Forms;using System.Drawing;usin... 阅读全文
posted @ 2014-07-03 16:56 清风暮雨 阅读(1470) 评论(1) 推荐(0)
C# 加密解密
摘要:方法一:#region 加密解密 /// /// MD5 32位加密 /// /// 待加密字符串 /// 加密后的字符串 public static string MD5Encode(string str) ... 阅读全文
posted @ 2014-07-03 16:53 清风暮雨 阅读(166) 评论(0) 推荐(0)
C# 固定字符串长度,不足补空格
摘要:C#在字串左(或右)加空格或指定char字符,使字串达到指定长度,如:string str1="你好";str1=str1.PadLeft(6,'3'); //无第二参数为加空格Response.Write(str1); //结果为“3333你好” , 字串长为6sql方法1:declare@a n... 阅读全文
posted @ 2014-07-01 15:58 清风暮雨 阅读(7757) 评论(0) 推荐(0)
C#屏蔽任务栏
摘要:在初始化事件里面加this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; 阅读全文
posted @ 2014-06-26 10:02 清风暮雨 阅读(185) 评论(0) 推荐(0)
C# 新增、修改XML
摘要:1.新增XMLtry { //初始化一个xml实例 XmlDocument myXmlDoc = new XmlDocument(); //创建xml的根节点 ... 阅读全文
posted @ 2014-06-25 14:25 清风暮雨 阅读(343) 评论(0) 推荐(0)
C# 设置语句间隔一段时间再执行
摘要:Thread.Sleep(1000)中的参数为毫秒 阅读全文
posted @ 2014-06-25 11:15 清风暮雨 阅读(742) 评论(0) 推荐(0)
C# 控制唯有回车时响应
摘要:注意2个事件用的方式是不一样的1.private void txtSiteCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ... 阅读全文
posted @ 2014-06-23 17:10 清风暮雨 阅读(158) 评论(0) 推荐(0)
C# 临时数据表
摘要:#region 临时数据表 /// <summary> /// 临时数据表 /// </summary> /// <returns></returns> private DataTable CreateTmpDable() { DataTable dt = new DataTable(); dt.C 阅读全文
posted @ 2014-06-23 16:11 清风暮雨 阅读(301) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 下一页