Watermark / hint text / placeholder TextBox

后端 未结 30 2570
遇见更好的自我
遇见更好的自我 2020-11-22 02:20

How can I put some text into a TextBox which is removed automatically when user types something in it?

30条回答
  •  青春惊慌失措
    2020-11-22 02:29

    Also, see this answer. You can accomplish this much more easily with a VisualBrush and some triggers in a Style:

     
        
            
        
    
    

    To increase the re-usability of this Style, you can also create a set of attached properties to control the actual cue banner text, color, orientation etc.

提交回复
热议问题