none
PhoneTextBox Style Problem

    General discussion

  • When i applied some style to phonetext and enter some text in it.

    after removed text from phonetext and don't loos focus form current phonetext box.and enter text in it agin .

    phonetextbox style is changed then applied style.

    Monday, January 02, 2012 3:42 AM

All replies

  • Hello Vivek

    can you post your Style Code here ?

    regards

    savia

    Monday, January 02, 2012 5:58 AM
  • Add this one in App.xaml

      <Application.Resources>
    <Style x:Key="phoneTextBoxStyle" TargetType="Control">

    <Setter Property="Foreground" Value="#FF000000" />
    <Setter Property="FontWeight" Value="Bold"/>
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="FontSize" Value="27" />
    <Setter Property="Background" Value="#FFFF0000" />
    <Setter Property="Margin" Value="5,0,0,0" />
    <Setter Property="Padding" Value="5,5,5,5" />

    </Style>
    </Application.Resources>
    
    
    Now in mainpage.xaml
    Style hintStyle = App.Current.Resources["phoneTextBoxStyle"] as Style;
    txt.Style = hintStyle;
    
    
    txt is name of PhoneTextBox control.
    Monday, January 02, 2012 6:35 AM
  • When do you set the Style?  Do you get this issue when you don't set a style?

    For the Style, why don't you set the Style in the XAML and set the TargetType to the PhoneTextBox control rather than the generic Control.

    Wednesday, January 04, 2012 12:06 PM