上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 44 下一页
摘要: 1.第一步,在子窗体关闭的时候返回一个 DialogResult 注意: 只对 ShowDialog() 方式有效 MessageBox.Show("修改学生信息成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question); this.Dialo 阅读全文
posted @ 2024-06-13 11:08 龙卷风吹毁停车场 阅读(116) 评论(0) 推荐(0)
摘要: 1. 将dataGridView 的选中方式设置为整行选中将 SelectionMode 属性设置为 FullRowSelect2. 判断当前是否有选中 this.dataGridView1.RowCount == 0 //没有选中 3. 获取当前选中行的id值 string studentId = 阅读全文
posted @ 2024-06-13 09:52 龙卷风吹毁停车场 阅读(212) 评论(0) 推荐(0)
摘要: 1. 在父窗体中,将 IsMdiContainer 的属性设置为true2. 再 new 子窗体的地方,指定子窗体的的父级窗体举例: 父窗体为 FrmMain.cs子窗体为 FrmAddStudent.cs FrmMain.cs文件 //没有创建窗体,则new 创建窗体 FrmAddStudent 阅读全文
posted @ 2024-06-12 21:24 龙卷风吹毁停车场 阅读(116) 评论(0) 推荐(0)
摘要: 没有禁止之前, 控件把我没有在控件上定义的属性全都显示出来了 我们不想要控件将我们没有定义的属性显示出来, //定义sql string sql = "select * from Students sd inner join StudentClass sc on sd.ClassId = sc.Cl 阅读全文
posted @ 2024-06-12 19:53 龙卷风吹毁停车场 阅读(18) 评论(0) 推荐(0)
摘要: 常用属性: 1.CustomFormat: 格式化在控件中的日期显示格式 2.Format : 确定日期和时间是用标准格式显示还是用自定义格式显示 常用方法: 获取选择的时间: Convert.ToDateTime( this.dateTimePicker1.value)获取年: Convert.T 阅读全文
posted @ 2024-06-12 16:53 龙卷风吹毁停车场 阅读(82) 评论(0) 推荐(0)
摘要: private void FrmAddStudent_Load(object sender, EventArgs e) { StudentClassServer studentClassServer = new StudentClassServer(); List<StudentClass> stu 阅读全文
posted @ 2024-06-12 09:36 龙卷风吹毁停车场 阅读(237) 评论(0) 推荐(0)
摘要: /// <summary> /// 获取多个结果集 /// </summary> /// <param name="sql"></param> /// <returns></returns> /// <exception cref="Exception"></exception> public st 阅读全文
posted @ 2024-06-12 09:28 龙卷风吹毁停车场 阅读(33) 评论(0) 推荐(0)
摘要: public static class Verify { /// <summary> /// 验证手机号码 /// </summary> /// <param name="str_handset"></param> /// <returns></returns> public static bool 阅读全文
posted @ 2024-06-11 19:44 龙卷风吹毁停车场 阅读(103) 评论(0) 推荐(0)
摘要: 需要使用到窗体的 FormClosing 事件 private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dialogResult = MessageBox.Show("是否确认关闭窗 阅读全文
posted @ 2024-06-11 19:15 龙卷风吹毁停车场 阅读(134) 评论(0) 推荐(0)
摘要: 1. 定义一个外部的变量,例如我要打开的窗体名称为 "FrmAddStudent" 这些代码在 FrmMain.cs文件中 2. 在 FrmAddStudent 窗体点击关闭的地方 从新初始化 frmAdd 的值为 null我这点为点击右上角关闭按钮事件 "FormClosed" 阅读全文
posted @ 2024-06-11 17:47 龙卷风吹毁停车场 阅读(33) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 44 下一页