[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2024
  • Last Modified:

How to display the date and time in the statusStrip Panel in C#.Net. The time should be dynamic

Hello,
In the VB.0 Project, the time was set automatically with MSComctlLib.StatusBar. The time is dynamic and it changes accordingly.
But in C#.Net using StatusStrip() does not do this automatically, How can i achieve the same functionality in C#.net
Thanks
0
MPakeezah
Asked:
MPakeezah
2 Solutions
 
HarryNSCommented:
You need to have a timer defined in your form and update the time in the status bar for every second.

private void timer1_Tick(object sender, System.EventArgs e)
{
    statusBar1.Panels[0].Text = DateTime.Now.ToShortTimeString();
}
0
 
Anurag ThakurCommented:
0
 
MPakeezahAuthor Commented:
Thanks, it was really helpful
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now