日期:2014-05-20 浏览次数:20891 次
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 TpSystem
{
public partial class Form1 : Form
{
//各人的票数
private int num1 = 0;
private int num2 = 0;
private int num3 = 0;
public Form1()
{
InitializeComponent();
label1.Text = "张三:";
label2.Text = "李四:";
label3.Text = "王五:";
//设置三个按钮的样式
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(Button))
{
Button btn = (Button)c;
btn.BackColor = Color.Red;