I was trying to customize the textbox control in the windows phone application. I have done with the customization of the textbox using controltemplate and when i run the application I can’t view the data that is being entered on to the textbox. the following is my xaml code:
<TextBox IsEnabled="True" Name="txtemailVal" Height="46"
BorderThickness="2" BorderBrush="Black" HorizontalAlignment="Left"
Margin="170,203,0,338" Width="258">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="LightSeaGreen"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5">
</Border>
</ControlTemplate>
</TextBox.Template>
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="EmailUserName"/>
</InputScope>
</TextBox.InputScope>
</TextBox>
could anyone help me to reslove this issue? Thanks in advance..
You are missing a control to actually “host” your text, by default this is a
ScrollViewer, so something like this should do the trick:Notice that the
ScrollVieweris calledContentElement. This is a “named part” and is documented in the MSDN article onTextBoxstlyes and templates for Silverlight as being the element where the text is displayed. Other controls have named parts, too, so if you’re customizing several controls, I suggest you take a look at the other articles too.