为了账号安全,请及时绑定邮箱和手机立即绑定

如何将以下代码添加滚动图片。

如何将以下代码添加滚动图片。

C#
毛毛爱笨蛋 2016-03-15 10:58:02
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 First{    public partial class Form1 : Form    {        string[] names = System.IO.File.ReadAllLines("names.txt");        Random r = new Random();      public Form1()        {            InitializeComponent();        }        private void button2_Click(object sender, EventArgs e)        {            this.button1.Visible  = true;        }        private void button1_Click(object sender, EventArgs e)        {            //string[] names=System.IO.File.ReadAllLines("names.txt");            //Random r = new Random();            //int a = r.Next(names.Length);            //this.label1.Text = "中奖的同学是:"+names[a];            if (this.timer1.Enabled)            {                this.timer1.Enabled = false;            }            else            {                this.timer1.Enabled = true;            }        }        private void timer1_Tick(object sender, EventArgs e)        {                        int a = r.Next(names.Length);            this.label1.Text = "中奖的同学是:" + names[a];        }            }}
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1118 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信