TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ankit Yadav
NA
762
38.7k
How to add Placeholder or Watermark to a Password box in WPF
Feb 5 2019 5:13 AM
I want to add placeholder to a password box i have achived that uptp some extent but the problem is that when i type the password, then the watermark text remains there like the image attached below:
<
Border
Margin
=
"0,0,0,10"
Grid.Column
=
"0"
Grid.Row
=
"4"
CornerRadius
=
"7"
BorderThickness
=
"1"
Grid.ColumnSpan
=
"2"
BorderBrush
=
"Gray"
>
<
PasswordBox
Grid.Row
=
"1"
Margin
=
"3,1,1,1"
Grid.Column
=
"1"
x:Name
=
"txtConfirmPassword"
BorderThickness
=
"0,0,0,0"
VerticalContentAlignment
=
"Center"
HorizontalContentAlignment
=
"Left"
Height
=
"35"
>
<
PasswordBox.Style
>
<
Style
xmlns:sys
=
"clr-namespace:System;assembly=mscorlib"
TargetType
=
"{x:Type PasswordBox}"
>
<
Style.Resources
>
<
VisualBrush
x:Key
=
"CueBannerBrush"
AlignmentX
=
"Left"
Stretch
=
"None"
>
<
VisualBrush.Visual
>
<
Label
Content
=
"Confirm Password"
Foreground
=
"Gray"
Padding
=
"10"
/>
</
VisualBrush.Visual
>
</
VisualBrush
>
</
Style.Resources
>
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding Password}"
Value
=
"{x:Null}"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource CueBannerBrush}"
/>
</
DataTrigger
>
<
Trigger
Property
=
"IsKeyboardFocused"
Value
=
"True"
>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
</
Trigger
>
</
Style.Triggers
>
</
Style
>
</
PasswordBox.Style
>
</
PasswordBox
>
</
Border
>
Reply
Answers (
4
)
Drag and drop particular column in group by
exporting the excel