one of the things you can drop onto a form ( like you drop a text box) is a timer. You would also need to create an action listener for your timer. i'm not sure on details of adding controls on the fly to a form, but you should easily be able to switch the visible status.

Mike

sounds like i fell into java syntax with 'action listener' but you click the lightning bolt in the control properties thing and add essentially a listener for your timer control. i wrote mine out in code first then linked it through that lightning bolt. google c# timer maybe get all the info you need.

private void frmImage_Load(object sender, EventArgs e)
    {
      new Action(CreateStuff).BeginInvoke(null, null);
    }

    private void CreateStuff()
    {
      DateTime dtStart = System.Diagnostics.Process.GetCurrentProcess().StartTime;
      while (DateTime.Now.Subtract(dtStart).TotalSeconds < 10) //10s
        System.Threading.Thread.Sleep(10);
      
      TextBox tb = null;
      this.Invoke(new MethodInvoker(
        delegate()
        {
          tb = new TextBox();
          tb.Location = new Point(0, 0);
          tb.Text = "abc123";
          tb.Name = "textbox12345";
          this.Controls.Add(tb);
        }));
      while (DateTime.Now.Subtract(dtStart).TotalSeconds < 20) //20s
        System.Threading.Thread.Sleep(10);
      this.Invoke(new MethodInvoker(
        delegate()
        {
          //Put this to the right of the textbox we created
          Label lbl = new Label();
          lbl.Location = new Point(tb.Left+tb.Width+10, 0);
          lbl.Text = "def123";
          this.Controls.Add(lbl);
        }));
    }

Edited 6 Years Ago by sknake: n/a

This question has already been answered. Start a new discussion instead.