c# - Null Password Char in Winform -


this question has answer here:

i have textbox in c# windows form having problems in assigning null values passwordchar. want if checkbox checked passwordchar should null i.e actual text should displayed else passwordchar should *. have tried

    private void checkbox1_checkedchanged(object sender, eventargs e)     {         if (!checkbox1.checked)         {             txtpassword.passwordchar = '*';         }         else         {             txtpassword.passwordchar = '';         }     } 

but line

     txtpassword.passwordchar = '';  

is generating error. have tried

     txtpassword.passwordchar = null; 

but still error.

please me correct code.

to reset passswordchar, txtpassword.passwordchar = '\0';

for convenience:

private void checkbox1_checkedchanged(object sender, eventargs e){    txtpassword.passwordchar = checkbox1.checked ? '*' : '\0'; } 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -