I’m trying to make a watermark appear inside a TexBox, I have done this with the Canvas tag:
<Canvas Height="60" Width="500" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,5">
<TextBox Width="500" Height="30" Canvas.Left="0" Canvas.Top="0" FontSize="18"></TextBox>
<TextBlock x:Name="whereAreyouWatermark" Canvas.Left="15" Canvas.Top="7" Height="30" FontSize="16"
Foreground="#777777" Width="500">
<Run x:Uid="text2"></Run> <Italic FontSize="13"><Run x:Uid="text3"></Run></Italic>
</TextBlock>
</Canvas>
However, now when the cursor goes over the textblock it’s not the “I” icon, just a normal pointer. In CSS, I would change the cursor like this “pointer: text”.
How can I do this in XAML?
Also, when pressed I want focus to go to the background textbox, I take it the best way is to just intercept the gotfocus event of the textblock and pass focus in-code to the textbox. I think in iOS you can use a layer which simply passes through events.
thanks very much
Much obliged to ya, as we say all the time in London 😉
I recommend having a look at the WinRT XAML Toolkit’s WatermarkTextBox.