C#Winform限制TextBox文本框只能输入文本的格式
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { //IsNumber判断输入的是不是数字 //e.KeyChar != (char)Keys.Back 判断输入的是不是退格 if (!(Char.IsNumber(e.K …… 阅读全文
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { //IsNumber判断输入的是不是数字 //e.KeyChar != (char)Keys.Back 判断输入的是不是退格 if (!(Char.IsNumber(e.K …… 阅读全文
declare @seconds int;set @seconds=7264;select CONVERT(varchar(50),(@seconds /3600))+' h '+CONVERT(varchar(50),(@seconds%3600)/60)+' m '+CONVERT(varchar(50),(@seconds%3600)/3600)+' s'2h1m4s …… 阅读全文
说明:窗体B由窗体A打开,当在窗体B中执行完某操作后,关闭窗体B,同时执行窗体A中的方法,比如:调用窗体A中加载数据的方法,实现数据的即时刷新 //窗体A中执行打开窗体B的Refresh()方法 frmB frm = new frmB(); if (frm.ShowDialog() == DialogResult.OK) …… 阅读全文
//选择文件夹 FolderBrowserDialog dia = new FolderBrowserDialog(); if (dia.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string filePath = dia.S …… 阅读全文
DataGridViewRow r1 = new DataGridViewRow(); r1.CreateCells(this.dataGridView1); r1.Cells[0].Value = false; r1.Cells[1].Value = type; r1.Cells[2].Value = …… 阅读全文
for (int i = 0; i < this.dataGridView1.Rows.Count; i++) { DataGridViewCheckBoxCell cb = (DataGridViewCheckBoxCell)this.dataGridView1.Rows[i].Cells[0]; bool …… 阅读全文