Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Silverlight
TextBox Class
TextBox Properties
 Watermark Property
Collapse All/Expand All Collapse All
.NET Framework Class Library for Silverlight
TextBox..::.Watermark Property

This property is not implemented.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
<EditorBrowsableAttribute(EditorBrowsableState.Never)> _
Public Property Watermark As Object
C#
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public Object Watermark { get; set; }

Property Value

Type: System..::.Object
This property is not implemented.
ExceptionCondition
NotImplementedException

In all cases.

Do not use this property. If you try to use this property, a NotImplementedException will be thrown.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Created my own watermark. Hope this helps everyone :)      Shrewd.Logic   |   Edit   |   Show History
$0'Note the namespace and class names. Just create two textboxes on called txtLogin and the other txtPassword$0 $0'Make sure you make the default textbox foreground color lightgray.$0 $0$0 $0 $0Imports System.Windows$0 $0Imports System.Windows.Controls$0 $0Imports System.Windows.Media$0 $0$0 $0 $0Namespace LoginNS$0 $0Partial Public Class Login$0 $0 'Make sure you make the default textbox foreground color lightgray.$0 $0 Public Sub New()$0 $0 InitializeComponent()$0 $0 AddHandler txtLogin.GotFocus, AddressOf LoginIsFocused$0 $0 AddHandler txtLogin.LostFocus, AddressOf LoginNotFocused$0 $0 AddHandler txtPassword.GotFocus, AddressOf PasswordIsFocused$0 $0 AddHandler txtPassword.LostFocus, AddressOf PasswordNotFocused$0 $0 End Sub$0 $0 Private Sub LoginIsFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0 $0 IsFocusedProps(txtLogin, "Enter a Login")$0 $0 End Sub$0 $0 Private Sub LoginNotFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0 $0 NotFocusedProps(txtLogin, "Enter a Login")$0 $0 End Sub$0 $0 Private Sub PasswordIsFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0 $0 IsFocusedProps(txtPassword, "Enter a Password")$0 $0 End Sub$0 $0 Private Sub PasswordNotFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0 $0 NotFocusedProps(txtPassword, "Enter a Password")$0 $0 End Sub$0 $0 Private Sub IsFocusedProps(ByVal focusedtxtbox As TextBox, ByVal txtboxtext As String)$0 $0 If focusedtxtbox.Text <> txtboxtext Then$0 $0 Exit Sub$0 $0 End If$0 $0 focusedtxtbox.Text = ""$0 $0 focusedtxtbox.Foreground = New SolidColorBrush(Colors.Black)$0 $0 End Sub$0 $0 Private Sub NotFocusedProps(ByVal focusedtxtbox As TextBox, ByVal txtboxtext As String)$0 $0 If focusedtxtbox.Text <> "" And focusedtxtbox.Text <> txtboxtext Then$0 $0 Exit Sub$0 $0 End If$0 $0 focusedtxtbox.Text = txtboxtext$0 $0 focusedtxtbox.Foreground = New SolidColorBrush(Colors.LightGray)$0 $0 End Sub$0 $0End Class$0 $0End Namespace$0
Tags What's this?: Add a tag
Flag as ContentBug
trying it in code reveals all      Anke6831   |   Edit   |   Show History
Where we stand appears to be that the compiler is fine with it, but it causes a runtime exception. MS folks, please give us this property. If not in TextBox, then in RichTextBox.


Wolf5370 said:
"As I have said before, stop wasting time on full length videos no one has time to watch and go back to putting out useful test based info we can search for and make use of."

AMEN to this!!! Videos certainly have their audiences, but for developers, text-based info, with screenshots where appropriate, is infinitely more useful than videos.
Tags What's this?: Add a tag
Flag as ContentBug
To USE or NOT to use?      Philip Mckee   |   Edit   |   Show History
Can anyone tell me where we are with this property. Documentation above contradicts itself?
Tags What's this?: Add a tag
Flag as ContentBug
I decided to use it, but didn't use it. or did i?      Alejandro Pauly ... Thomas Lee   |   Edit   |   Show History
the document says both to use it in SL4 and to not use it. so which one is it?

thanks.

Watermark      Wolf5370   |   Edit   |   Show History
Does anyone in M$ actually read these comments - it would appear not - absolutely pointless document - "only supported in Silverlight 4"..."Do not use in Silverlight 4" - bprevious comments from other confused readers and no reply/comment/correction by M$, As I have said before, stop wasting time on full length videos no one has time to watch and go back to putting out useful test based info we can search for and make use of.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker