I want to add a little Button, which removes all the text in the TextBox. Is it possible to put this \"Remove\"-Button into the TextBox (like i
Got something using interactivity, but you probably can manage without:
class ClearTextAction : TriggerAction { public static readonly DependencyProperty TargetProperty = DependencyProperty.Register("Target", typeof(TextBox), typeof(ClearTextAction), new UIPropertyMetadata(null)); public TextBox Target { get { return (TextBox)GetValue(TargetProperty); } set { SetValue(TargetProperty, value); } } protected override void Invoke(object parameter) { Target.Clear(); } }
You could make the button only show upon TextBox-MouseOver by adding this style to it: