C#窗体程序:设计一个配置选择器,输出电脑选择配置 - GXUZF.COM - 林澈思的茶

C#窗体程序:设计一个配置选择器,输出电脑选择配置

分类:折腾 ; 热度:3123 ; 最后更新于2020 年 02 月 14 日

赵帆同学赵帆同学

C#窗体程序:设计一个配置选择器,输出电脑选择配置
窗体界面

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "您选择的配置是:" + "\r\n";
if (comboBox1.Text == "联想")
textBox1.Text += comboBox1.Text + "\r\n";
if (comboBox1.Text == "方正")
textBox1.Text += comboBox1.Text + "\r\n";
if (comboBox1.Text == "Dell")
textBox1.Text += comboBox1.Text + "\r\n";
if (comboBox1.Text == "兼容机")
textBox1.Text += comboBox1.Text + "\r\n";
if (radioButton1.Checked == true)
textBox1.Text += radioButton1.Text + "\r\n";
if (radioButton2.Checked == true)
textBox1.Text += radioButton2.Text + "\r\n";
if (radioButton3.Checked == true)
textBox1.Text += radioButton3.Text + "\r\n";
if (radioButton4.Checked == true)
textBox1.Text += radioButton4.Text + "\r\n";
if (radioButton5.Checked == true)
textBox1.Text += radioButton5.Text + "\r\n";
if (checkBox1.Checked)
textBox1.Text += checkBox1.Text + "\r\n";
if (checkBox2.Checked)
textBox1.Text += checkBox2.Text + "\r\n";
if (checkBox3.Checked)
textBox1.Text += checkBox3.Text + "\r\n";
}
}
}


评论卡