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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:47:17+00:00 2026-06-15T09:47:17+00:00

I am working on a change password windows form application in C# (visual studio).

  • 0

I am working on a change password windows form application in C# (visual studio). This is how my application will work, after the user have enter their new password and pass the textbox validation a tick will be shown beside the new password textbox.

The problem i am facing is how can i check that the retyped password is same as the new password that is being entered? After checking that they are the same, the tick will appear to show the user that it is checked and the same. I do not want to click any button to check both the textbox instead checking once the user have stop typing. How can i do that?

  • 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-15T09:47:17+00:00Added an answer on June 15, 2026 at 9:47 am

    Create a new windows forms project. Put two textboxes on the form, nothing more. Use their default names of textBox1 and textBox2 Put the code below in Form1.cs (as this is the default name of the file). Now when ever a user has pressed a key, the comparement will be made. If the text is the same, the backcolor of the textboxes becomes green, otherwise it becomes red.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                textBox1.KeyUp += textBox_Compare;
                textBox2.KeyUp += textBox_Compare;
            }
    
            private void textBox_Compare(object sender, KeyEventArgs e)
            {
                Color cBackColor = Color.Red;
                if (textBox1.Text == textBox2.Text)
                {
                    cBackColor = Color.Green;
                }
                textBox1.BackColor = cBackColor;
                textBox2.BackColor = cBackColor;
            }
        }
    }
    

    Note that I did not use the designer to attach the KeyUp event, I did that in the constructor of Form1: textBox1.KeyUp += textBox_Compare;

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

Sidebar

Related Questions

I have the following code, and it will not work. I am currently working
In my asp.net Web app. I have a change password form that is not
I read this post but I can't get it working: Change Background Color... I
jquery change function on dropdown is not working at my application and working at
I have an ASP.NET web forms application that requires that requires that a user
I have link change password in my home page..NOw i am telling you what
I am working on a website. I have to find the value of user
I'm writing a script in PHP to allow a user to change their password.
I am writing a JSF page, where user can change his password. I based
I have a remoting service which uses the Windows Auth. Been working fine for

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.