C#:03窗体介绍:checkBox,radioButton,MDI,PictureBox

本文介绍了C#编程中如何使用MDI窗体,以及PictureBox控件来显示图片。重点讲解了如何实现定时换图功能,并探讨了定时随机播放图片的实现方法。
摘要由CSDN通过智能技术生成

namespace _07老师和学生登录
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
//--------------------------------------------------------------------------------
		//最开始,通过判断哪个radioButton1.Checked被选中进行判断
        private void button1_Click(object sender, EventArgs e)
        {
            //先做里面的if,根据需求再加这个外层if
            if (radioButton1.Checked == true || radioButton2.Checked == true)
            {
                
                if (radioButton1.Checked == true)
                {
                    if (textBox1.Text == "student" && textBox2.Text == "student")
                        MessageBox.Show("学生登录成功");
                    else
                    {
                        MessageBox.Show("登录失败");
                        textBox1.Clear();
                        textBox2.Clear();
                        textBox1.Focus();
                    }
                }
                else
                {
                    if (textBox1.Text == "teacher" && textBox2.Text == "teacher")
                        MessageBox.Show("老师登录成功");
                    else
                    {
                        MessageBox.Show("登录失败");
                        textBox1.Clear();
                        textBox2.Clear();
                        textBox1.Focus();
                    }
                }
            }
            else
            {
                MessageBox.Show("请首先选择一个身份!");
            }
        }
    }
}

MDI窗体


                
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值