I think you are trying to do something very, very wrong here, that has nothing to do with UseSystemPasswordChar :
private void butShowPWChars_Click(object sender, EventArgs e)
{
tbPassword.UseSystemPasswordChar = false;
}
private void butHidePWChars_Click(object sender, EventArgs e)
{
tbPassword.UseSystemPasswordChar = true;
}
Works exactly as I expect: Hidden, text shows as blobs, shown, it is readable again.
If I type "Hello " then hide the data, I get 6 blobs. If I then add "There." I see twelve blobs.
Show the text again, and I see "Hello There.".
At no time to I get a handle problem.
Post the code fragment you are trying to use to do this: I think your problem may be more fundamental.
[edit]Updated to answer Musefan - OriginalGriff[/edit]
"Perhaps the error is caused when changing while the control has focus? Which sounds like is what the OP is trying. I see your button clicks will take the focus"
I tried this as well:
private void tbPassword_Enter(object sender, EventArgs e)
{
tbPassword.UseSystemPasswordChar = false;
}
private void tbPassword_Leave(object sender, EventArgs e)
{
tbPassword.UseSystemPasswordChar = true;
}
Still no handle problems.