熟悉简单的c++可视化编程,使用Visual Studio软件进行编写,代码简单

创建项目

完善设计,添加元件

 

        代码段

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 WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "student" && textBox2.Text == "123456")
                 MessageBox.Show("登陆成功!");
            else
                MessageBox.Show("账号或密码错误!");
        }
    }
}

        实现窗体显示

更多推荐

C#之可视化编程