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

  • SEARCH
  • Home
  • 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 6799775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:53:19+00:00 2026-05-26T18:53:19+00:00

A need some help, I have a TextBlock that contains a string like this

  • 0

A need some help, I have a TextBlock that contains a string like this 00:00:00 And I want to create a timer that will count every second e.g.00:00:01 , 00:00:02 etc

So the stupid thing that I do is to take the value of the text box

string[] times = myTextbox.Text.Split(':');
int hours = Int32.Parse(times[0]);
int minutes = Int32.Parse(times[1]);
int seconds = Int32.Parse(times[2]);

Then I increase the right variable and finally I join them again and put them back in the textblock, BUT now my counter is like this: 0:0:1, 0:0:2, …

I know the problem, its very logical but my question is how can I solve it 🙂

Thank you very much.

  • 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-26T18:53:20+00:00Added an answer on May 26, 2026 at 6:53 pm

    Instead of splitting the text of the textbox i would use DateTime.Parse like this:

    var time = DateTime.Parse(myTextBox.Text);
    

    then add a second:

    time = time.AddSeconds(1);
    

    and then finally, putting it back out there:

    myTextBox.Text = time.ToString("myPattern");
    

    where myPattern is replaced with any of the patterns described here: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help with a query. I have this simple table: CREATE TABLE
Need some help joining these two tables I have two views that looks like
i need some help here. I have a dialog box that contains an iFrame
I need some help. Right now i have done a file search that will
I need some help here. I have a mysql table called dictionary like this:
Need some help about with Memcache. I have created a class and want to
Need some help to solve this. I have a gridview and inside the gridview
I need some help in solving this problem. We have a large amount of
Need some help, I have a regular expression that appears to work just fine
I need some help. I have a UITableView that has cells that hold the

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.