02 2012 档案
摘要:winform中以Panel为例的MouseDown事件为:private void panelposition_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ //分别用e.X,e.Y来获取鼠标的x,y坐标(e.X,e.Y分别为整数) int x=e.X;int y=e.Y;}wpf中以Image为例的MouseDown事件为:private void imageposition_MouseDown(object sender, MouseButtonEventArgs e){ //采用e.GetPosit..
阅读全文
摘要:winform中以Panel为例的MouseDown事件为:private void panelposition_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ //判断鼠标左键按下 if(e.Button == System.Windows.Forms.MouseButtons.Left){//...} //判断鼠标左键按下 if(e.Button == System.Windows.Forms.MouseButtons.Right){//...} }wpf中以Image为例的MouseDown事件...
阅读全文
摘要:int input_count = Convert.ToInt32(this.txtinNum.Text.Trim()); //输入的数量int temp = 0; //记录临时总数int temp_count = 0; //记录库存总数Hashtable ht = new Hashtable();for (int i = 0; i < list.Count; i++){temp = list[i].Count + temp_count - input_count;if (temp <= 0){temp_count += list[i].Count;ht.Add(list[i].I
阅读全文
摘要:例1:List<object> list=new List<object>(); //一个数据集合for(int i=0; i<list.Count-1; i++){int index=0; //重复列数据标记for(int j=i+1; j<list.Count-1; j++){//此处判断重复列if(list[i].列==list[j].列){index++;//此处做相应的操作}}//在一圈寻找结束后,判断,寻找的结果,根据结果来操作具体数据if(index==0){//说明不存在列重复数据}}
阅读全文
摘要:SELECT SUM([count]) AS total, pro_typeFROM goodsInWHERE (pro_type IN ('LM1117-5V', 'AD8532A', 'LM32445412', '74HC595D', 'IMP706PESA','HT7150', '74HC573DADFAEWR23', 'LM2576-5V', 'D71-54L-10', 'HEF4016', 'PC817',
阅读全文
摘要:Access也有IsNull函数,但意义和参数却和T-SQL中的不同。在T-SQL(也就是SQL Server所支持的SQL语言)中,IsNull的作用是把空值替代成指定的值。然而在Access中,IsNull的作用仅仅是判断是否为空值,而且参数的个数也和T-SQL中的不一样,只有一个输入参数。庆幸的是Access支持iif,所以可以这样去替代:Select iif(IsNull( express ), value1, value2 ) From TableNameiif(IsNull( express ), value1, value2 )相当于:If express Is Null The
阅读全文
摘要:原文地址:xml文件中特殊字符的处理作者:心灵征途xml文件中特殊字符的处理 在XML中,起始和结束标记之间出现的所有合法字符都被忠实地传给XML处理程序。为了避免把字符数据和标记中需要用到的一些特殊符号相混淆,XML还提供了一些有用的实体引用。实体引用的作用是,当在字符数据中需要使用这些特殊符号时,我们采用它的实体引用来代替。这些特殊的XML实体引用包括:> >< <& &" "’' 这样,如果我们需要在"示例"这个标记中出现文本"<姓名>张
阅读全文
摘要:<<小于号> > 大于号& & 和' ' 单引号" ' 双引号 换行
阅读全文
摘要:PointToScreen(Mouse.GetPosition(this));Win32 API GetCursorPos用法: [StructLayout(LayoutKind.Sequential)] public struct POINTt { public int X; public int Y; public POINTt(int x, int y) { this.X = x; this.Y = y; } } [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern bool Ge
阅读全文
摘要:/// <summary>/// 将图片Image转换成Byte[]/// </summary>/// <param name="Image">image对象</param>/// <param name="imageFormat">后缀名</param>/// <returns></returns>public static byte[] ImageToBytes(Image Image, System.Drawing.Imaging.ImageFormat
阅读全文