摘要: private DataGridViewTextBoxEditingControl CellEdit = null; // 声明 一个 CellEdit private void dgvConsume_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { CellEdit = (DataGridViewTextBoxEditingControl)e.Control; CellEdit.SelectAll(); CellEdit.KeyPress += Cells_KeyPres. 阅读全文
posted @ 2013-09-22 17:29 xalyf 阅读(279) 评论(0) 推荐(1) 编辑
摘要: sql语句:select column1,column2=stuff((select ','+column2 from table1 where column1=t1.column1 for xml path('')),1,1,'')from table1 t1group by column1 阅读全文
posted @ 2012-08-17 15:57 xalyf 阅读(145) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 根据鼠标位置返回dgv的行索引与列索引 /// </summary> /// <param name="nX">当前X坐标</param> /// <param name="nY">当前Y坐标</param> /// <param name="dgv">DataGridView控件</param> /// <returns></returns> public static Poin 阅读全文
posted @ 2012-07-06 10:01 xalyf 阅读(1048) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;namespace golfmanage.BaseClass{ /// 输入法帮助,全角 转换为半角 /// </summary> public class ImeHelper { #region 声明一些API函数 [DllImport("imm32.dll")] publi... 阅读全文
posted @ 2012-06-04 16:34 xalyf 阅读(678) 评论(0) 推荐(0) 编辑
摘要: 1、定义调用一个父类IParentUctonrol:View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ClinicDoctor.Class{ public interface IParentUseControl { /// <summary> /// 分页功能方法。获取数据 /// </summary> /// <param name="nPagenum">显示的当前页码</... 阅读全文
posted @ 2012-01-09 14:30 xalyf 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 项目中用到太多窗体控件,按回车选择下一个TablIndex控件方法:SelectNextControlpublic bool SelectNextControl( Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)参数ctl类型:System.Windows.Forms.Control从其上开始搜索的Control。forward类型:System.Boolean如果为true则在 Tab 键顺序中前移;如果为false则在 Tab 键顺序中后移。tabStopOnly类型:System.Booleantru 阅读全文
posted @ 2012-01-09 14:18 xalyf 阅读(1082) 评论(0) 推荐(0) 编辑
摘要: slqserver:select * from( select a.column1,a.column2,a.column3 , row_number() over(order by a.column1) as rn from table_a) as tbwhere tb.rn between 1 and 500db2:select * from( select a.column1,a.column2,a.column3 , rownumber() over(order by a.column1) as rn from table_a) as tbwhere tb.rn between ... 阅读全文
posted @ 2011-12-01 13:37 xalyf 阅读(199) 评论(0) 推荐(0) 编辑
摘要: c# winform 添加等待界面 利用Gif图片实现 阅读全文
posted @ 2011-08-30 10:58 xalyf 阅读(4607) 评论(2) 推荐(1) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2011-07-20 17:29 xalyf 阅读(6) 评论(0) 推荐(0) 编辑
摘要: #region 自动转换为半角//声明一些API函数 [DllImport("imm32.dll")]public static extern IntPtr ImmGetContext(IntPtr hwnd);[DllImport("imm32.dll")]public static extern bool ImmGetOpenStatus(IntPtr himc);[DllImport("imm32.dll")]public static extern bool ImmSetOpenStatus(IntPtr himc, bool 阅读全文
posted @ 2011-07-04 10:24 xalyf 阅读(1014) 评论(0) 推荐(0) 编辑
摘要: 拖动不规程窗体分三个步骤:1、响应窗体Mouse_Down事件,记录鼠标左键按下时的坐标2、响应窗体的Mouse_Move事件,获取当前鼠标相对屏幕的坐标减去以上获得X,Y坐标,赋值给窗体Location3、响应窗体的Mouse_Up事件,释放拖动操作 Point _MouseOffset; bool _IsMouseDown = false; private void Form_MouseDown(object sender, MouseEventArgs e) { int xOffset; int yOffset; if (e.Button == MouseButtons.Left) { 阅读全文
posted @ 2011-07-04 10:20 xalyf 阅读(462) 评论(1) 推荐(0) 编辑