How to hide the password text in the edit box to create an office tape

I am building an application using visual studio and I am doing Excel Addon.
I would like to add a username and password field, so I use Editbox for this, but it doesn't seem to be a password field.

What can I use instead or how to hide the text?

I'm currently trying to convert characters to *, but very slowly.
Im also working in C #

This is my current solution:

private void ebxPassword_KeyUp(object sender, RibbonControlEventArgs e)
{
    char last = ebxPassword.Text[ebxPassword.Text.Length - 1];
    passwordText += last;
    ebxPassword.Text = ebxPassword.Text.Replace(last.ToString(), "*");
}

My final decision:

This cannot be done; there is no easy way around it.
Therefore, instead of having these controls in the ribbon, I added a login button, and when I click, a form with a standard text field loads, and it works fine.

+4
1

. , , .

, , .. , ... ;) :

public static string Mask_IT(this string source, char MaskingChar, int AllowedCharCount)
  {
     var cArr = source.ToCharArray();

     if(source.Length - AllowedCharCount >=0)
     {

         for (int i = 0; i < ( cArr.Length - AllowedCharCount; i++ )
         {
          if (cArr[i] != MaskingChar) cArr[i] = MaskingChar;
         }
     }

         return cArr.ToString();
  }

:

private void yourTextBasedComponent_TextChanged (object sender, EventArgs e)
{
   return YourTextBasedComponent.Text.Mask_IT('*', 2);
}

- 1: TextChanged . Text_Changed ( , ) . , - - string, Key-Up KeyDown - .. Text_Changed , ;)

- 2: "AllowedCharCount".. " (n) "

+3

Source: https://habr.com/ru/post/1530754/


All Articles