C# - How To Hide And Show Password Using C#

C# - How To Hide And Display Password Text Using C#

                                                                                             

In This C# Tutorial We Will See How To  Show And Hide Password Text In TextBox  With A CheckBox Using CSharp Programming Language .


Source Code :

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 Csharp_And_MySQL
{
    public partial class Show_Hide_Password : Form
    {
        public Show_Hide_Password()
        {
            InitializeComponent();
        }

        private void checkBox_Show_Hide_CheckedChanged(object sender, EventArgs e)
        {
            if(checkBox_Show_Hide.Checked)
            {
                textBox_Password.UseSystemPasswordChar = true;
            }
            else
            {
                textBox_Password.UseSystemPasswordChar = false;
            }
        }
    }
}



Share this

Related Posts

Previous
Next Post »