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 8671601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:59:21+00:00 2026-06-12T18:59:21+00:00

How to validate text in textbox control in winforms? I have a control, where

  • 0

How to validate text in textbox control in winforms?
I have a control, where user have to put string, like “13:55”. I want to show MessageBox, when this value will be diffrent, than “XX:YY”.
How to do it?
In asp.net it was so easy to make, but how to implement it on winforms?

  • 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-06-12T18:59:22+00:00Added an answer on June 12, 2026 at 6:59 pm

    Check out the MaskedTextBox if you don’t want to have to validate in the first place.

    var l_control = new MaskedTextBox();
    l_control.Mask = "00\:00";
    

    If you want to make the first digit optional:

    l_control.Mask = "90\:90";
    

    Otherwise, you could use a regular expression. 4 digits separated by a colon would be: @"^\d{2}:\d{2}$". (The @ symbol prevents C# from treating ‘\’ as an escape character – nothing unique to regex.)

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

Sidebar

Related Questions

I have custom control with asp textbox inside. And i need to Validate by
i have asp text box and button control. <asp:TextBox ID=txtFName runat=server CssClass=sfInputbox></asp:TextBox> <asp:Button runat=Server
My problem: I would like to validate the user input of a TextBox using
I have the following text box control ; <asp:TextBox ID=txtAmount runat=server AutoPostBack=true Width=85px class=validate[ERExpenseTypeDaterequired,custom[float]]
I want to validate a textbox have numeric values using the following code, but
I have a Panel control that contains some control such as text boxes.I want
I am using Telerik captcha control without textbox and now i want to validate
I need to validate the text box value from the generated html table (grid)
I have the following code to validate two text box entries to make sure
If I want to validate that a text box contains an integer greater than

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.