找传奇、传世资源到传世资源站!

迎春年会抽奖示例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboardusing 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 gzcj{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } int djs = 0; private void pictureBox1_Click(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { label1.BackColor = Color.Transparent; label1.Parent = pictureBox1; label2.BackColor = Color.Transparent; label2.Parent = pictureBox1; } private void textBox4_TextChanged(object sender, EventArgs e) { if (textBoxxygz2.Text.Equals(textBoxxygz1)) { textBoxxygz2.Text = huojianghao(textBox1.Text).ToString(); } } private void label8_Click(object sender, EventArgs e) { } private void timer1_Tick(object sender, EventArgs e) { string hj2, hj3, hj4, hj5; if (djs == 0) { djs = int.Parse(textBox2.Text); } djs = djs - 1; labeldjs.Text = "倒计时:" djs.ToString(); if (textBox3.Text == "1") { textBoxxygz1.Text = huojianghao(textBox1.Text).ToString(); Thread.Sleep(100); textBoxxygz2.Text = huojianghao(textBox1.Text).ToString();} if (textBox3.Text == "2") { textBoxxygz3.Text = huojianghao(textBox1.Text).ToString(); Thread.Sleep(100); textBoxxygz4.Text = huojianghao(textBox1.Text).ToString(); } if (textBox3.Text == "3") { textBoxxygz5.Text = huojianghao(textBox1.Text).ToString(); Thread.Sleep(100); textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } if (djs == 0) { timer1.Enabled = false; axWindowsMediaPlayer1.Ctlcontrols.stop(); textBox3.Text = (int.Parse(textBox3.Text) 1).ToString(); } } private void button1_Click(object sender, EventArgs e) { timer1.Enabled = true; labeldjs.Text = "倒计时:" textBox2.Text; axWindowsMediaPlayer1.URL = "D:\\bj.mp3"; axWindowsMediaPlayer1.Ctlcontrols.play();//播放文件 } private int huojianghao(string s) { int hm = 0; Random rd = new Random();//随机种子 hm = rd.Next(1, (int.Parse(s))); return hm; } private void button2_Click(object sender, EventArgs e) { textBox3.Text = "1"; textBoxxygz1.Text = ""; textBoxxygz2.Text = ""; textBoxxygz3.Text = ""; textBoxxygz4.Text = ""; textBoxxygz5.Text = ""; textBoxxygz6.Text = ""; } private void textBoxxygz3_TextChanged(object sender, EventArgs e) { if (textBoxxygz3.Text.Equals(textBoxxygz1)) { textBoxxygz3.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz3.Text.Equals(textBoxxygz2)) { textBoxxygz3.Text = huojianghao(textBox1.Text).ToString(); } } private void textBoxxygz4_TextChanged(object sender, EventArgs e) { if (textBoxxygz4.Text.Equals(textBoxxygz1)) { textBoxxygz4.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz4.Text.Equals(textBoxxygz2)) { textBoxxygz4.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz4.Text.Equals(textBoxxygz3)) { textBoxxygz4.Text = huojianghao(textBox1.Text).ToString(); } } private void textBoxxygz5_TextChanged(object sender, EventArgs e) { if (textBoxxygz5.Text.Equals(textBoxxygz1)) { textBoxxygz5.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz5.Text.Equals(textBoxxygz2)) { textBoxxygz5.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz5.Text.Equals(textBoxxygz3)) { textBoxxygz5.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz5.Text.Equals(textBoxxygz4)) { textBoxxygz5.Text = huojianghao(textBox1.Text).ToString(); } } private void textBoxxygz6_TextChanged(object sender, EventArgs e) { if (textBoxxygz6.Text.Equals(textBoxxygz1)) { textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz6.Text.Equals(textBoxxygz2)) { textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz6.Text.Equals(textBoxxygz3)) { textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz6.Text.Equals(textBoxxygz4)) { textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } if (textBoxxygz6.Text.Equals(textBoxxygz5)) { textBoxxygz6.Text = huojianghao(textBox1.Text).ToString(); } } private void button3_Click(object sender, EventArgs e) { FileDialog open = new OpenFileDialog(); //wxWindowsMediaplayer1是控件名 this.axWindowsMediaPlayer1.settings.playCount = 2;//播放次数; open.Filter = "*.mp3|*.mp3"; open.Title = "打开文件"; if (open.ShowDialog() == DialogResult.OK) { axWindowsMediaPlayer1.URL = open.FileName; axWindowsMediaPlayer1.Ctlcontrols.play();//播放文件 } } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复