摘要: private void tbSite_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar==13) { MessageBox.Show("你按了回车键"); } } 阅读全文
posted @ 2012-03-25 22:06 氺〤魚Oo。 阅读(692) 评论(0) 推荐(0) 编辑
摘要: 窗体的关闭用:this.Close();程序的退出用:Application.Exit(); 阅读全文
posted @ 2012-03-25 16:13 氺〤魚Oo。 阅读(156) 评论(0) 推荐(0) 编辑
摘要: //获取用户选择的行的数据... String str = "开户公司/网址:"; str+= this.dataGridView.CurrentRow.Cells[1].Value.ToString(); //加列名 str += "\n\n用户名/卡号:"; str += this.dataGridView.CurrentRow.Cells[2].Value.ToString(); //加列名 str += "\n\n密码:"; str += this.dataGridView.CurrentRow.Cells[3].Value. 阅读全文
posted @ 2012-03-25 14:59 氺〤魚Oo。 阅读(275) 评论(0) 推荐(0) 编辑
摘要: //判断用户选择的是哪一行,注意行数从0开始... int row = this.dataGridView.CurrentRow.Index; String str = String.Format("你当前选择的是第{0}行",row+1); MessageBox.Show(str); 阅读全文
posted @ 2012-03-25 14:41 氺〤魚Oo。 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 呵呵,C#字符串格式化操作和C、C++、Java等有点区别,值得注意哦!...//C#中已经没有%d,%s,%f等,取而代之的是{i} ,i=0、1、2....String str = String.Format("{0}+{1}的结果为:{2}",1,2,(1+2)); 阅读全文
posted @ 2012-03-25 14:36 氺〤魚Oo。 阅读(127) 评论(0) 推荐(0) 编辑