这妞不错!

会有那么一天...

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

2012年12月23日

摘要: dgvA.EnableHeadersVisualStyles = false;//这一句很重要,否则下面的列头设置不起作用dgvA.Columns["UnLoadCountHas"].HeaderCell.Style.ForeColor = Color.Red; 阅读全文
posted @ 2012-12-23 19:45 这妞不错 阅读(4336) 评论(0) 推荐(0)

2012年11月24日

摘要: //判断读取到的文本中,是否有重复的项 var linq = from s in list group s by new { s.Code } into newGroup where newGroup.Count() > 1 select newGroup; if (linq.ToList().Count > 0) { MessageBox.Show("有重复的项,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } #region 定义导入对象 /// & 阅读全文
posted @ 2012-11-24 11:45 这妞不错 阅读(2806) 评论(0) 推荐(0)

摘要: //ps:txt导入文本格式导入单号(判断),单号,数值,导入数量(判断)CL2012110200416,MD132479864,0,20#region 方法--扫描导入 /// <summary> /// 方法--扫描导入 /// </summary> private void Import() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"; openFileDialo 阅读全文
posted @ 2012-11-24 11:40 这妞不错 阅读(2345) 评论(1) 推荐(0)

摘要: if (txtEmployeeName.Text.Trim() != "" )//姓名 精确查询 { if (dgvInfoB["EMPLOYEENAME", i].Value.ToString().Trim() == txtEmployeeName.Text.Trim())//表格中的数据==查询条件 { dgvInfoB.CurrentCell = dgvInfoB["EMPLOYEENAME", i]; dgvInfoB.Rows[i].Selected = true;//选中行 break; } } 阅读全文
posted @ 2012-11-24 11:36 这妞不错 阅读(6953) 评论(0) 推荐(0)

2012年7月11日

摘要: 1.DGV表格中数值列输入,设置列的类型 2.修改DGV的属性,设置EditMode为EditOnEnter 3. 当表格中的行可能需要按delete键删除,则需要在DGV添加事件CellMouseClickprivate void dgv_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex == -1) { DataGridView dgv = (DataGridView)sender; if (dgv.Current 阅读全文
posted @ 2012-07-11 15:33 这妞不错 阅读(564) 评论(0) 推荐(0)

2012年3月29日

摘要: #region 事件--表格CellContentClick(DGV中checkBox单选)private void dgvInfo2_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex > -1)//屏蔽表头、列头 { if (e.ColumnIndex == 0)//注释此行代码,即点击行的任何列都勾选当前数据(e.ColumnIndex == 0设置为勾选列) { DataGridViewCheckBoxCe 阅读全文
posted @ 2012-03-29 20:07 这妞不错 阅读(2154) 评论(0) 推荐(0)

摘要: 几个经常用到的字符串的截取string str="123abc456";int i=3;1 取字符串的前i个字符 str=str.Substring(0,i); // or str=str.Remove(i,str.Length-i); 2 去掉字符串的前i个字符: str=str.Remove(0,i); // or str=str.Substring(i); 3 从右边开始取i个字符: str=str.Substring(str.Length-i); // or str=str.Remove(0,str.Length-i);4 从右边开始去掉i个字符: str=str. 阅读全文
posted @ 2012-03-29 13:45 这妞不错 阅读(25169) 评论(1) 推荐(1)

2012年1月13日

摘要: c# DateTime.Now 当前日、月、季度、年 当前上日、上月、上季度、上年代码:当前日、月、季度、年DateTime now = DateTime.Now; switch (_frm.cboReport.SelectedIndex)//日报 月报 季报 年报 { case 0: searchObj.AcceptDateStart = Convert.ToDateTime(now.ToString("d") + " 00:00:00"); searchObj.AcceptDateEnd = Convert.ToDateTime(now.ToStri 阅读全文
posted @ 2012-01-13 16:29 这妞不错 阅读(3694) 评论(0) 推荐(0)

摘要: c#的DateTime.Now函数详解//2008年4月24日 System.DateTime.Now.ToString("D"); //2008-4-24 System.DateTime.Now.ToString("d"); //2008年4月24日 16:30:15 System.DateTime.Now.ToString("F"); //2008年4月24日 16:30 System.DateTime.Now.ToString("f"); //2008-4-24 16:30:15 System.DateTim 阅读全文
posted @ 2012-01-13 15:32 这妞不错 阅读(574) 评论(0) 推荐(0)

2011年9月20日

摘要: private void dgvSearch_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //if (e.RowIndex > -1 && e.ColumnIndex > -1)//双击表头或列头时不起作用 if (e.RowIndex > -1)//双击表头不起作用 {主窗体代码:private void 双击弹出_Click(object sender, EventArgs e) { 弹出窗体 s = new 弹出窗体(); if (s.ShowDia... 阅读全文
posted @ 2011-09-20 18:26 这妞不错 阅读(233) 评论(0) 推荐(0)