Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 409851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:49:52+00:00 2026-05-12T17:49:52+00:00

I have a main form called mainForm – this runs my entire app. In

  • 0

I have a main form called mainForm – this runs my entire app.
In this form I create other forms like this:

......
......

  Form[] formMessage = new Form[10];

  int formNumber = 0;       

  System.Windows.Forms.Button btnCancel;
  System.Windows.Forms.Button btnClose;
  System.Windows.Forms.Label lblTimer;
  System.Windows.Forms.Button btnOK;
  System.Windows.Forms.Panel panel1;
  System.Windows.Forms.Label lblMessage;
  System.Windows.Forms.PictureBox pictureBox1;
  System.Windows.Forms.Label lblTitle;

......
......
public void CreateForm(Form form2)
   {
       this.btnCancel = new System.Windows.Forms.Button();
       this.btnClose = new System.Windows.Forms.Button();
       this.lblTimer = new System.Windows.Forms.Label();
       this.btnOK = new System.Windows.Forms.Button();
       this.panel1 = new System.Windows.Forms.Panel();
       this.lblMessage = new System.Windows.Forms.Label();
       this.pictureBox1 = new System.Windows.Forms.PictureBox();
       this.lblTitle = new System.Windows.Forms.Label();
       // 
........
       // 
       // lblTimer
       // 
       this.lblTimer.AutoSize = true;
       this.lblTimer.BackColor = System.Drawing.Color.Transparent;
       this.lblTimer.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.lblTimer.Location = new System.Drawing.Point(9, 120);
       this.lblTimer.Name = "lblTimer";
       this.lblTimer.Size = new System.Drawing.Size(0, 16);
       this.lblTimer.Visible = Show_Timer;
       this.lblTimer.TabIndex = 4;

       form2.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       form2.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       form2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
       form2.ClientSize = new System.Drawing.Size(400, 142);
       form2.ControlBox = false;

       form2.Controls.Add(this.pictureBox1);
       form2.Controls.Add(this.panel1);
       form2.Controls.Add(this.btnOK);
       form2.Controls.Add(this.lblTimer);
       form2.Controls.Add(this.btnCancel);


       form2.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
       form2.Opacity = 0.98;
       form2.ShowInTaskbar = false;
       form2.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
       form2.Tag = formNumber;
       form2.Paint += new System.Windows.Forms.PaintEventHandler(this.MyMessageBox_Paint);       

   }


private void FNeventTrigger(System.Object sender, System.EventArgs e)
{

   formMessage[formNumber] = new Form();
   CreateForm(formMessage[formNumber]);
   formMessage[formNumber].Show();
   formNumber++;
   if (formNumber == 10)
       formNumber = 0;
}

public void lbl_timer_UpdateText()
{
    this.lblTimer.Text = newText
}

I use the FNeventRigger to create my form, and I can have upto 10 of them open at each given time – I use this for showing count down timers.

The problem I have is how do I show the count down timer of each form?
If I use : this.lblTimer.Text = newText, then only the newest form that was opened displays the correct timer…. the other forms lblTimer.Text stop functioning.

Is there a way to address all the lblTimer.Text on all forms opened on the array?

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:49:52+00:00Added an answer on May 12, 2026 at 5:49 pm

    Create your own form class which defines the Label an a method to update this method.
    and then initiate all your forms using this new MyBaseForm

    public MyBaseForm : Form
    {
        private Label lblTimer;
        public MyBaseForm()
        {
            lblTimer = new Label();
            Controls.Add(lblTimer);
        }
        public void UpdateTimerText(string text)
        {
            lblTimer.Text = text;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form called MainForm.cs. When I click Enter The Progam button I
I have WPF Application where I have One main form and other user controls
I have a main windows form (MainForm.cs) where I created an instance of Customer
I have one form called: MyControlContainerForm ccf and a main form called: SolidForm sf
I have the class called mainForm that it is main window of my program.
Lets say I have a form called MainForm and a control on it: somelabel.
I have a winform with a form called MainForm. I have a static class
I'm developing a Windows Form application in C#. I have a main form called
I have two forms. The first form Main has 2 buttons and a link
I have a main Form. There is a linklabel. If i click on it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.