基本信息
源码名称:C# 精美抽奖程序
源码大小:5.28M
文件格式:.zip
开发语言:C#
更新时间:2017-01-10
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
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 Lottery
{
public partial class Form1 : Form
{
int N = 100;
int turn = 0;
int[] a = new int[1000];
Random random = new Random((int)DateTime.Now.Ticks);
public Form1()
{
InitializeComponent();
label1.Parent = pictureBox3;
label1.BackColor = Color.Transparent;
turn = 0;
for (int i = 0; i < 1000; i )
a[i] = 0;
}
private void timer1_Tick(object sender, EventArgs e)
{
}
private void pictureBox2_Click(object sender, EventArgs e)
{
this.timer3.Stop();
turn ;
if (turn == 1)
T1.Text=label1.Text;
else if (turn == 2)
T2.Text = label1.Text;
else if (turn == 3)
T3.Text = label1.Text;
else if (turn == 4)
T4.Text = label1.Text;
else if (turn == 5)
T5.Text = label1.Text;
if(textBox1.Text.Length!=0)
a[int.Parse(label1.Text)] = 1;
}
private void timer2_Tick(object sender, EventArgs e)
{
}
private void timer3_Tick(object sender, EventArgs e)
{
while(true)
{
int x = random.Next() %N 1;
if(a[x]==0)
{
label1.Text = x.ToString();
break;
}
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
}
private void label2_Click(object sender, EventArgs e)
{
}
private void T3_Click(object sender, EventArgs e)
{
}
private void pictureBox5_Click(object sender, EventArgs e)
{
textBox1.Text = "";
T1.Text = "";
T2.Text = "";
T3.Text = "";
T4.Text = "";
T5.Text = "";
label1.Text = "";
turn = 0;
}
private void timer4_Tick(object sender, EventArgs e)
{
}
private void pictureBox4_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0)
return;
N = int.Parse(textBox1.Text);
for (int i = 0; i < 1000; i )
a[i] = 0;
}
private void timer4_Tick_1(object sender, EventArgs e)
{
}
private void timer5_Tick(object sender, EventArgs e)
{
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
this.pictureBox1.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\开始3-动态.png";
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
this.pictureBox1.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\开始3.png";
}
private void pictureBox1_Click_1(object sender, EventArgs e)
{
this.timer3.Interval = 50;
this.timer3.Start();
}
private void pictureBox2_MouseDown(object sender, MouseEventArgs e)
{
this.pictureBox2.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\结束-动态.png";
}
private void pictureBox2_MouseUp(object sender, MouseEventArgs e)
{
this.pictureBox2.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\结束.png";
}
private void pictureBox4_MouseDown(object sender, MouseEventArgs e)
{
this.pictureBox4.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\设置-动态.png";
}
private void pictureBox4_MouseUp(object sender, MouseEventArgs e)
{
this.pictureBox4.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\设置.png";
}
private void pictureBox5_MouseDown(object sender, MouseEventArgs e)
{
this.pictureBox5.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\清空2-动态.png";
}
private void pictureBox5_MouseUp(object sender, MouseEventArgs e)
{
this.pictureBox5.ImageLocation = "F:\\抽奖程序\\Lottery\\Lottery\\清空2.png";
}
}
}