2014年3月18日

C# 控件及常用设计整理

摘要: 1 、窗体1 、常用属性( 1 ) Name 属性:用来获取或设置窗体的名称,在应用程序中可通过 Name 属性来引用窗体 。( 2 ) WindowState 属性: 用来获取或设置窗体的窗口状态。 取值有三种: Normal ( 窗体正常显示)、 Minimized(窗体以最小化形式显示)和 Maximized (窗体以最大化形式显示)。( 3 ) StartPosition 属性:用来获取或设置运行时窗体的起始位置。( 4 ) Text 属性:该属性是一个字符串属性,用来设置或返回在窗口标题栏中显示的文字。( 5 ) Width 属性:用来获取或设置窗体的宽度。( 6 ) Height 阅读全文

posted @ 2014-03-18 16:41 连一粝 阅读(409) 评论(0) 推荐(0) 编辑

TextBox控件中只输入整数的几种方法

摘要: 方法一. if(e.KeyChar!=8&&!Char.IsDigit(e.KeyChar)&&e.KeyChar!='.'){ e.Handled = true; } 方法二: if ((e.KeyChar 57) && (e.KeyChar != 8) &&e.KeyChar!='.'){ e.Handled = true; }方法三:if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && 阅读全文

posted @ 2014-03-18 10:27 连一粝 阅读(1002) 评论(0) 推荐(1) 编辑

c#鼠标移动到Button 改变颜色

摘要: private void button1_MouseMove(object sender, MouseEventArgs e){ button1.BackColor = Color.Blue;}private void button1_MouseLeave(object sender, EventArgs e){ button1.BackColor = Color.White;} MouseMove和MouseLeave和配合使用,不然鼠标离开之后就变不回原色了。 阅读全文

posted @ 2014-03-18 09:52 连一粝 阅读(2423) 评论(0) 推荐(0) 编辑

C#编写条形码扫描

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace 条形码扫描{ public partial class Form1 : Form { BarCodeHook BarCode = new BarCodeHook(); public Form1() { ... 阅读全文

posted @ 2014-03-18 09:21 连一粝 阅读(1538) 评论(0) 推荐(0) 编辑

C#编程中的crc16校验

摘要: C# CRC16 查表法private static ushort[] crctab = new ushort[256]{ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c 阅读全文

posted @ 2014-03-18 09:17 连一粝 阅读(2373) 评论(0) 推荐(0) 编辑

导航