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";
}
}
}