TextBox.Watermark Property (System.Windows.Controls)

Switch View :
ScriptFree
.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)
Syntax

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.
Exceptions

Exception Condition
NotImplementedException

In all cases.

Remarks

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

Version Information

Silverlight

Supported in: 5, 4
Platforms

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

See Also

Reference

Community Content

Shrewd.Logic
Created my own watermark. Hope this helps everyone :)
$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

Anke6831
trying it in code reveals all
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.

Philip Mckee
To USE or NOT to use?
Can anyone tell me where we are with this property.  Documentation above contradicts itself?

Thomas Lee
I decided to use it, but didn't use it. or did i?
the document says both to use it in SL4 and to not use it. so which one is it?

thanks.


Wolf5370
Watermark
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.