1.vb.net 多次滚动抽奖的奖源奖源程序代码
vb.net 多次滚动抽奖的程序代码
我用多线程写的,你可以参考下。码抽nacos源码下载系统界面图如下:(注:重置功能为清除已经中奖号码,代码javadubbo源码大全回归1-都可以中奖状态。奖源奖源vue reactive源码)
代码:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
System.Threading.Thread g_Thread = null;
List<int> g_list = new List<int>();
int g_Num = 0;
delegate void g_delegate();
/// <summary>
/// 开始
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender,码抽vosc公式源码 EventArgs e)
{
if(g_list.Count==)
{
MessageBox.Show("所有数字已使用,请重置!代码flink源码打包");
return;
}
button3.Enabled = true;
Random r = new Random();
g_delegate dele= ChangeTxt;
g_Thread = new System.Threading.Thread(() =>
{
while(this.IsDisposed==false)
{
g_Num = r.Next(1,奖源奖源 );
if(g_list.Contains(g_Num))
{
g_Num = 1;
}
while(g_list.Contains(g_Num))
{
g_Num++;
}
this.Invoke(dele);
System.Threading.Thread.Sleep();
}
});
g_Thread.Start();
}
void ChangeTxt()
{
label2.Text = g_Num.ToString();
}
/// <summary>
/// 停止
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
//if(g_Thread.ThreadState==System.Threading.ThreadState.Running)
{
g_Thread.Abort();
g_list.Add(Convert.ToInt(label2.Text));
}
button3.Enabled = false;
}
/// <summary>
/// 重置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
g_list.Clear();
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
System.Environment.Exit(0);
}
}
2024-11-29 20:361338人浏览
2024-11-29 20:09704人浏览
2024-11-29 19:172835人浏览
2024-11-29 19:07750人浏览
2024-11-29 18:561666人浏览
2024-11-29 18:102143人浏览
1.声光偏转器AODF)在高速荧光成像中的关键作用:FIRE技术简介2.FIRE生活简介3.盘点 2023 十大免费/开源 WAF4.M-Audio FireWire Audiophile技术指标5.
1.iPhone XR/XS/XS Max “电池健康”显示“维修”是什么情况?2.苹果新举措严防第三方更换iPhone 电池,具体有哪些影响?iPhone XR/XS/XS Max “电池健康”显示