随笔分类 -  C#

vs2010安装路径解决不能修改的方法
摘要:环境:win7 64位解决:网上说需要卸载以下4项Microsoft Visual Studio Tools for Applications 2.0 - ENUMicrosoft Visual Studio Tools for Applications 2.0 Language Pack - CH... 阅读全文
posted @ 2015-09-16 22:47 凌波小屋 阅读(10029) 评论(0) 推荐(0)
C#winform程序自定义鼠标样式
摘要:public void SetCursor(Bitmap cursor, Point hotPoint) { int hotX = hotPoint.X; int hotY = hotPoint.Y; Bitmap m... 阅读全文
posted @ 2015-08-19 15:42 凌波小屋 阅读(2181) 评论(0) 推荐(0)
把窗体传给另一个窗体最基础方法
摘要:这是form1 1 public partial class Form1 : Form 2 { 3 4 public Form1() 5 { 6 InitializeComponent(); 7 } 8 9 ... 阅读全文
posted @ 2015-07-30 22:57 凌波小屋 阅读(825) 评论(0) 推荐(0)
在WinForm应用程序中,使用选项卡控件来加载不同的Form界面!
摘要:1 TabPage tp=new TabPage(); 2 your选项卡控件.Controls.Add(tp); 3 4 From1 frm=new Form1(); 5 frm.TopLevel = false; 6 frm.Dock = DockStyle.Fill; 7 frm.Form... 阅读全文
posted @ 2015-07-26 21:21 凌波小屋 阅读(2154) 评论(0) 推荐(0)
C#(WinForm)上传图片保存到数据库和从数据库读取图片显示到窗体
摘要:1 //浏览图片 2 3 private void btnUp_Click(object sender, EventArgs e) 4 5 { 6 7 OpenFileDialog ofd = new OpenFil... 阅读全文
posted @ 2015-07-17 16:49 凌波小屋 阅读(4129) 评论(0) 推荐(1)
Listbox与dataGridView的获取鼠标点击事件的区别!!!
摘要:1 int index = lisxian.IndexFromPoint(e.X, e.Y);//获取鼠标点击 2 lisxian.SelectedIndex = index;Listbox获取鼠标的代码!!!!1 int index = e.RowIndex; 2 DataGridViewRow ... 阅读全文
posted @ 2015-06-07 16:17 凌波小屋 阅读(438) 评论(0) 推荐(0)
鼠标点击单元格显示在相应文本框中的方法(单元格事件)
摘要:1 //点击单元格显示此行相应内容 2 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 3 { 4 // 找到鼠标点击的行 5 ... 阅读全文
posted @ 2015-05-25 14:26 凌波小屋 阅读(1420) 评论(0) 推荐(0)
C#操作求出SQL中某一字段所有行的和方法!
摘要:1 DataTable table = xx.sqlcha(sql1);//调数据库2 int v = 0;3 foreach(DataRow row in table.Rows)//遍历所查出记录所有行4 {5 ... 阅读全文
posted @ 2015-05-07 15:17 凌波小屋 阅读(530) 评论(0) 推荐(0)
判断用户输入是否为int整型方法之一!
摘要:1 int age = 0; 2 string vv = this.textBox2.Text; 3 if (int.TryParse(vv, out age)) 4 { 5 age = in... 阅读全文
posted @ 2015-04-24 15:49 凌波小屋 阅读(2245) 评论(0) 推荐(1)