Show/Hide in Password Field | C Sharp Winform | Visual Studio 2019 | Code Screens

preview_player
Показать описание
This video is about designing a text box which acts as a password field with show and hide options.

Source code:

using System;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button3_Click(object sender, EventArgs e)
{
if(textBox2.PasswordChar=='*')
{
button4.BringToFront();
textBox2.PasswordChar = '\0';
}
}

private void button4_Click(object sender, EventArgs e)
{
if (textBox2.PasswordChar == '\0')
{
button4.BringToFront();
textBox2.PasswordChar = '*';
}
}
}
}

Like, Share and Subscribe for more videos.

#csharp #vs2019
Рекомендации по теме
Комментарии
Автор

thanks for the code really simple and easy to understand ! this helped me in my project :) thanks alot!

t.zhxngyu
Автор

Sir I'm using 2015 version of visual studio in that password char property not have so myself getting an error what I do ???

divyagade
Автор

good job buddy. It works without a problem. Thank you so much

kriskata
Автор

help for some reason my hide button wants to be on top of the show button

SilencePlaysRust
Автор

Why when I click on the eye, it disappears and doesn't show the eye to encode

who.am.i
Автор

can u put it the the discrip hte code pls

ziiqq
Автор

Hii Mera code work kr raha but.... Ek ke upar ke button dala Toh work Nhi hota

sushantsawant
Автор

Help! It stop work when i start typing!

andreboaventura