Archived
1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SomeLab/CS/lab15/15_2/Form1.cs
2026-03-19 19:39:01 +08:00

72 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 _15_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Submit_Click(object sender, EventArgs e)
{
MessageBox.Text = NameBox.Text + "您好欢迎进入C#世界!\n";
MessageBox.Text += "您的密码是:" + PassWord.Text + "\n";
if (Male.Checked)
{
MessageBox.Text += "您的性别是男。\n";
}
if (Female.Checked)
{
MessageBox.Text += "您的性别是女。\n";
}
if (School.SelectedIndex>-1)
{
MessageBox.Text += "您的学校是:" + School.SelectedItem.ToString() + "\n";
}
else
{
MessageBox.Text += "您没有选择学校。\n";
}
if (Major.SelectedIndex>-1)
{
MessageBox.Text += "您的专业是:" + Major.SelectedItem.ToString() + "\n";
}
else
{
MessageBox.Text += "您没有选择专业。\n";
}
MessageBox.Text += "您的爱好有:\n";
if (Sports.Checked)
{
MessageBox.Text += "体育运动 ";
}
if (Music.Checked)
{
MessageBox.Text += "音乐 ";
}
if (literary.Checked)
{
MessageBox.Text += "文学 ";
}
if (Manage.Checked)
{
MessageBox.Text += "管理 ";
}
if ((!Sports.Checked) && (!Music.Checked) && (!literary.Checked) && (!Manage.Checked))
{
MessageBox.Text += "您没有选择爱好。\n";
}
}
}
}