C#C
C#3y ago
14 replies
Thalnos

✅ Placeholder text in WPF control

Hi there, I want placeholder text like we have on html input fields in a WPF Textbox. I couldn't find a suitable property maybe I overlooked it. Any guidance?
How I do it right now is I handle this manually meaning I handle Focus and LostFocus events and set initial text brighter than user input and clear on Focus and set it back to the placeholder text on LostFocus in case there wasn't any input. I was hoping I wouldn't have to do this myself lol
Was this page helpful?