×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    19

    Smile themes in phone7

    hi,


    I created a page.i want to change the background of Textbox when theme of emulator is changed to light.The letters cant be visible while changing the themes.plz help me is there any solution?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    920

    Re: themes in phone7

    In c# you can do something like this:

    Visibility lightThemeVisible = (Visibility)Resources["PhoneLightThemeVisibility"];
    if (lightThemeVisible == System.Windows.Visibility.Visible)
    {
    // do code for light theme
    }
    else
    {
    // do code for dark theme
    }

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Location
    India
    Posts
    138

    Re: themes in phone7

    Hi Yogesh,

    In Addition to João Cardoso.

    You have to set few properties see below code snippet for the same.
    XAML code
    Code:
    <TextBox GotFocus="textBox1_GotFocus" Background="YellowGreen" BorderBrush="Red" BorderThickness="1" Foreground="Black" Height="72" HorizontalAlignment="Left" Margin="94,414,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="281" />
    C# Code

    Code:
    private void textBox1_GotFocus(object sender, RoutedEventArgs e)
            {
                Visibility lightThemeVisible = (Visibility)Resources["PhoneLightThemeVisibility"];
                if (lightThemeVisible == System.Windows.Visibility.Visible)
                {
                    // do code for light theme
                    textBox1.Background = new SolidColorBrush(Colors.Red);
                }
                else
                {
                    // do code for dark theme
                    textBox1.Background = new SolidColorBrush(Colors.Green);
                }
            }
    However you can also have a look this article for handling Theme in WP7 TextBox Light theme problems - the solution

    Hope it helps.
    Pavan Pareta
    Sr. Software Engineer
    http://windows-mobile-dev.blogspot.com

  4. #4
    Registered User
    Join Date
    May 2012
    Posts
    23

    Re: themes in phone7

    Maybe it is possible to use converter to do that. I never try but you can check

Similar Threads

  1. Themes
    By Severe in forum Streaming and Video
    Replies: 1
    Last Post: 2006-10-12, 15:33
  2. s 60 themes
    By mattz23 in forum Streaming and Video
    Replies: 0
    Last Post: 2006-10-11, 08:42
  3. Themes for N91
    By geoxis in forum Streaming and Video
    Replies: 0
    Last Post: 2005-12-21, 09:01
  4. About themes
    By vspecial in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2004-12-29, 22:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •