C#可视化编程技术总结:制作可视化窗体软件

笔记:
详情已经在前面的章节有列述了,这里只点出几个比较重要的:
string name = DataGridView对象.SelectedRows[0].Cells[0].Value.ToString();获取在DataGridView控件中选中的一行的第cells[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.Threading.Tasks;using System.Windows.Forms;namespace product6._10{    public partial class FrmAmendClient : Form    {public FrmAmendClient(){    InitializeComponent();}    //非空验证提示    private void textName_TextChanged(object sender, EventArgs e)    {string name = textName.Text;if(string.IsNullOrEmpty(name)){    labName.ForeColor = Color.Red;    labName.Text = "*";}else{    labName.Text = "";}    }    private void textTel_TextChanged(object sender, EventArgs e)    {string tel = textTel.Text;if (string.IsNullOrEmpty(tel)){    labTel.ForeColor = Color.Red;    labTel.Text = "*";}else{    labTel.Text = "";}    }    private void radMan_CheckedChanged(object sender, EventArgs e)    {if(radMan.Checked == false && radWoman.Checked == false){    labSex.Text = "*";    labSex.ForeColor = Color.Red;}

                                                        

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2022年8月26日
下一篇 2022年8月26日

相关推荐