The Perfect Day

分享技术,编写未来

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  73 随笔 :: 0 文章 :: 24 评论 :: 86799 阅读
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

随笔分类 -  [B] WinForm开发(C#)

1 2 下一页

摘要:[代码] 阅读全文
posted @ 2009-09-25 15:09 StephenJu 阅读(617) 评论(1) 推荐(1) 编辑

摘要:引自博客:Yes I Can 什么是.Net异步调用机制 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSyste... 阅读全文
posted @ 2009-09-11 12:21 StephenJu 阅读(526) 评论(0) 推荐(0) 编辑

摘要:[代码] 阅读全文
posted @ 2009-09-10 19:46 StephenJu 阅读(264) 评论(0) 推荐(0) 编辑

摘要:[代码] 阅读全文
posted @ 2009-01-04 16:37 StephenJu 阅读(299) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;namespace Wind... 阅读全文
posted @ 2008-12-11 00:26 StephenJu 阅读(389) 评论(0) 推荐(0) 编辑

摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceSys{publicpar... 阅读全文
posted @ 2008-06-10 11:45 StephenJu 阅读(4231) 评论(1) 推荐(0) 编辑

摘要:ValidateDataintheWindowsFormsDataGridViewControlSamples: private void dataGridView1_CellValidating(object sender,DataGridViewCellValidatingEventArgs e){// Validate the CompanyName entry by disallowing... 阅读全文
posted @ 2008-05-28 21:29 StephenJu 阅读(1019) 评论(0) 推荐(0) 编辑

摘要://如果有超过一屏的数据,想通过关键字查找到相关记录,然后再定位之,做法如下://遍历所有行,把某单元格的值和关键字对比,找到后清除所有选择行,然后把当前行设为选择,然后把grid的CurrentCell设置为当前行的某个可见单元格即可,效果就会自动跳到定位好的行上。 string str = textBox1.Text.Trim(); foreach (DataGridViewRow dgvRo... 阅读全文
posted @ 2008-05-26 15:33 StephenJu 阅读(349) 评论(1) 推荐(0) 编辑

摘要:Boolean createdNew; //返回是否赋予了使用线程的互斥体初始所属权 System.Threading.Mutex instance = new System.Threading.Mutex(true, "MutexName", out createdNew); //同步基元变量 if (createdNew) //赋予了线程初始所属权,也就是首次使用互斥体 { Appli... 阅读全文
posted @ 2008-05-26 15:31 StephenJu 阅读(431) 评论(0) 推荐(0) 编辑

摘要:假设我们的DataTable有5K左右的数据 那么,我们需要对他进行更加快速的操作 正常我们可能使用DataView.RowFilter来作 如果一两次都无所谓,如果要对DataView的RowFilter/Sort进行大批量的操作--该操作会导致DataTable索引重建.因为RowFilter Sort的设置会 导致DataView索引的建立 那么,是不建议的,应该使用 1.设置DataV... 阅读全文
posted @ 2008-05-26 15:25 StephenJu 阅读(856) 评论(0) 推荐(0) 编辑

摘要://*********************************************************// 主要属性: Description:树视图控件上显示的说明文本,如上图中的”选择要进行计算的目录”; RootFolder:获取或设置从其开始浏览的根文件夹,如上图中设置的我的电脑(默认为桌面); SelectedPath:获取或设置用户选定的路径,如... 阅读全文
posted @ 2008-05-26 15:09 StephenJu 阅读(265) 评论(0) 推荐(0) 编辑

摘要://创建主菜单 private void CreateMenus() { MenuStrip mainMenu = new MenuStrip(); DataSet ds = new DataSet(); string xmlMenuIndo = System.Windows.F... 阅读全文
posted @ 2008-05-26 14:58 StephenJu 阅读(333) 评论(0) 推荐(0) 编辑

摘要:一、排序 1 获取DataTable的默认视图 2 对视图设置排序表达式 3 用排序后的视图导出的新DataTable替换就DataTable (Asc升序可省略,多列排序用","隔开) DataView dv = dt.DefaultView; dv.Sort = "id Asc,name Desc"; dt = dv.ToTable(); 二、检索 1 设置查询字符串 2 使用Selec... 阅读全文
posted @ 2008-05-26 14:54 StephenJu 阅读(295) 评论(0) 推荐(0) 编辑

摘要:DataRow dr = ds.Tables["student"].NewRow(); dr.ItemArray = ds.Tables["student"].Rows[0].ItemArray; ds.Tables["student"].Rows.Add(dr); //===========================1===============================// ... 阅读全文
posted @ 2008-05-26 14:53 StephenJu 阅读(2774) 评论(0) 推荐(0) 编辑

摘要:void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { DataGridView dgv = (DataGridView)sender; if (e.Control is DataGr... 阅读全文
posted @ 2008-05-26 14:52 StephenJu 阅读(664) 评论(0) 推荐(0) 编辑

摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; namespace StephenJu.Second { ... 阅读全文
posted @ 2008-05-26 14:33 StephenJu 阅读(335) 评论(0) 推荐(0) 编辑

摘要:using (SqlConnection sqlconn = new SqlConnection("server=.;uid=sa;pwd=yuling1310;database=smls")) { SqlCommand sqlcmd = new SqlCommand("getcerti_notesbigtext", sqlconn); ... 阅读全文
posted @ 2008-05-26 12:28 StephenJu 阅读(1209) 评论(0) 推荐(0) 编辑

摘要:private void ExportToExcel() { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Execl files (*.xls)|*.xls"; saveFileDialog.Fi... 阅读全文
posted @ 2008-05-05 13:24 StephenJu 阅读(2622) 评论(1) 推荐(1) 编辑

摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms; using ... 阅读全文
posted @ 2008-04-11 20:59 StephenJu 阅读(457) 评论(0) 推荐(0) 编辑

摘要:引自:梦在脚下,让心灵去飞翔 http://www.cnblogs.com/CodeAnyWhere/archive/2005/12/13/296461.html 项目需要,稍微修改了ComboBoxDataGridView 代码如下: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.... 阅读全文
posted @ 2008-02-22 21:19 StephenJu 阅读(1438) 评论(0) 推荐(0) 编辑

1 2 下一页
点击右上角即可分享
微信分享提示