Search code examples
vb.netwinformstextboxvisual-studio-2022bunifu

Issue with Bunifu Controls: UseSystemPasswordChar affecting Placeholder Text


I'm encountering an unexpected behavior with Bunifu controls in my VB.NET application. Specifically, when I set the 'UseSystemPasswordChar' property to True for a Bunifu TextBox, it not only replaces the entered characters with the password character but also affects the placeholder text.

enter image description here

In the standard .NET TextBox, setting UseSystemPasswordChar to True only affects the entered characters, not the placeholder text. However, in Bunifu controls, it seems to be altering both.

Has anyone else experienced this issue, or is there a specific way to handle this behavior in Bunifu controls? I've checked the documentation, but it doesn't provide insights into this specific scenario.

Placeholder Text: enter image description here


Solution

  • In the text changed Event.

    if(sender == null) return;
    var BTextBox = (BunifuTextBox)sender;
    if(BTextBox.Text.Length > 0)
    {
        BTextBox.UseSystemPasswordChar = true;
    }
    else
    {
        BTextBox.UseSystemPasswordChar = false;
    }