c#摇奖 50分在线等

来源:百度知道 编辑:UC知道 时间:2024/06/22 13:48:50
界面是4个textbox 起始显示的是“*”
下面又2个command显示 开始和结束
按“开始” 每个textbox不规则随机显示0到9
按“结束” textbox各显示一个数字 比如1479
并弹出窗口“中奖号码是****”
才学c# 不知道需不需要用到timer控件
在线等 要全部代码
可以跟帖发 可以发到邮箱 邮箱是light2127@hotmail.com
好的我可以加分

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

namespace 抽奖演示
{
public partial class Form1 : Form
{

//使用委托来处理线程内控件
delegate void SetText(TextBox txt, string Number);
Thread th; //设置一个线程

/// <summary>
/// 委托处理函数
/// </summary>
/// <param name="txt"></param>
/// <param name="number"></param>
private void GetText(TextBox txt, string number)
{
if (txt.InvokeRequired)
{
isStop = false;
SetText s = new SetText(GetText);
this.Invoke(s, new object[] { txt, number });