当然不成了,当显示了一个后,再次循环label1就成了新的字符了

解决方案 »

  1.   

    我的意思就是要当第一个号码显示过后,第二个号码立即显示。就是说所有的号码都显示 在一个LABEL上,实现抽奖的号码滚动的效果啊,我现在就是一闪而过啊
      

  2.   

    //挂起当前线程3毫秒
    Thread.Sleep(100);改为://挂起当前线程3毫秒
    Thread.Sleep(1000);试试?
      

  3.   

    try
    label1.Text += rs[j];
      

  4.   

    to OMyDoG()
    不行啊,无论我挂起多久都不行啊,始终不能出现号码变换显示的效果,总是一闪而过啊to  saucer(思归)
    你的方法更不行了
      

  5.   

    为什么不行?label1.Text += rs[j].ToString();
      

  6.   

    label1.Text = rs[j];
    Thread.Sleep(100);换一下顺序呢,要不你用timer控件
      

  7.   

    to saucer(思归) ( 
    你的程序是吧所有的号码全部显示label上了,我要的是号码变化显示阿
    to whxbb(whxbb) (交换顺序也不行阿,用TIMER控件?怎么用阿,给我个思路好吗,谢谢
      

  8.   

    试试using System;
    using System.Collections;
    using System.Windows.Forms;class LabelTestForm : Form
    {
      Label label1;
      Button button1;
      ArrayList aList;  public LabelTestForm()
      {
    aList = new ArrayList();
    for (int i=1; i <=5; i++)
     aList.Add(i.ToString()); label1 = new Label(); label1.Text = "";
            label1.Size = new System.Drawing.Size(64, 16);
            label1.Location = new System.Drawing.Point(88, 40);

    Controls.Add(label1); button1 = new Button();
    button1.Text = "Click Me!";
    button1.Location = new System.Drawing.Point(88, 100);
            button1.Size = new System.Drawing.Size(100, 40); button1.Click += new EventHandler(btnClick); Controls.Add(button1);
      }  void btnClick(Object sender, EventArgs e)
      {
    //MessageBox.Show(aList.Count.ToString());
    for (int i=0; i < aList.Count; i++)
    {
    MessageBox.Show(aList[i].ToString());
    //label1.Text += aList[i].ToString();
    label1.Text = aList[i].ToString();
    }
      }  static void Main()
      {
    Application.Run(new LabelTestForm());
      }
    }
      

  9.   

    to saucer(思归) 
    我都使用过了什么arrlist,数组阿,记录集阿都不行,你用MessageBox.Show(aList[i].ToString());
    每一次点击可以看出效果,但是你吧这行取消,看看,是不是一闪而过阿,
      

  10.   

    label1.Text = aList[i].ToString();
    Update();
    Thread.Sleep(1000);
      

  11.   

    谢谢 saucer(思归) 我的 qq1789666
      

  12.   

    我把程序改成这样,就可以了,但是 我使用UPDATE的时,效果时出来了,但是运行中其他的控件都死了,。为什么 
    for( j=0;j<rs.Length;j++){ 
             
                            //   arr.Add(rs[j]); 
                                label1.Text = rsid[j]+rs[j]; 
                                Thread.Sleep(100); 
                                label1.Update(); 
                                if (j==rs.Length-1) j=0; 
                                //if (j==-1) break; 
                                 
                     }  
      

  13.   

    嘿嘿, kphaitao(Headman) 说得对,你需要用Timer,譬如using System;
    using System.Threading;
    using System.Collections;
    using System.Windows.Forms;class LabelTestForm : Form
    {
      System.Windows.Forms.Timer Clock;
      Label label1;
      Button button1;
      ArrayList aList;  int n=0;  public LabelTestForm()
      {

    aList = new ArrayList();
    for (int i=1; i <= 5; i++)
     aList.Add(i.ToString()); label1 = new Label(); label1.Text = "";
            label1.Size = new System.Drawing.Size(64, 16);
            label1.Location = new System.Drawing.Point(88, 40);

    Controls.Add(label1); button1 = new Button();
    button1.Text = "Click Me!";
    button1.Location = new System.Drawing.Point(88, 100);
            button1.Size = new System.Drawing.Size(100, 40); button1.Click += new EventHandler(btnClick); Controls.Add(button1);
      }  void btnClick(Object sender, EventArgs e)
      {
    Clock=new System.Windows.Forms.Timer();
         Clock.Interval=1000;
         Clock.Start();
         Clock.Tick+=new EventHandler(Timer_Tick);
      }  public void Timer_Tick(object sender,EventArgs eArgs)
      {
         if (n < aList.Count)
         {
        label1.Text = aList[n].ToString();
    //Update();
    n++;
    button1.Enabled = false;
         }     if (n >= aList.Count)
         {
    n=0;
    Clock.Stop();
    button1.Enabled = true;
         }
      }  static void Main()
      {
    Application.Run(new LabelTestForm());
      }
    }
      

  14.   

    to kphaitao(Headman) 能不能给个简单的裂字
      

  15.   

    to kphaitao(Headman) 能不能给个简单的裂字