Search code examples
c#wpftextboxtextblock

Implementation for entering a password: How to click on the TextBox located under the TextBlock?


I'm trying to make an alternative way for a password binding (I know there are different ways)

I put a textblock and a textbox in the same location

The user will write inside the textbox, its foreground will be transparent

The textblock will bind with the length of the textbox's text and show "*"s according to the length.

when I'll hold down some "eye icon" the textblock will not be visible and the the textbox's foreground will be black

The problem is that when I put them both together, the block blocks the box and I can't write in it.

Maybe it's just a property I didn't find, "priority" or something

Would like a suggestion on what should I do, thank you :)


Solution

  • Only you should change controls code position! enter image description here

    change
    enter image description here

    enter image description here