Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User yogeshg's Avatar
    Join Date
    Jun 2012
    Posts
    19
    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 joaocardoso's Avatar
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    510
    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
    }
    Cheers

    João Cardoso

  3. #3
    Registered User pavan.pareta's Avatar
    Join Date
    Jan 2009
    Location
    India
    Posts
    125
    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
    Nokia Developer Champion amlimonet's Avatar
    Join Date
    May 2012
    Posts
    23
    Maybe it is possible to use converter to do that. I never try but you can check

Similar Threads

  1. Themes for X3-02 and C3-01
    By aphreek in forum Themes/Carbide.ui
    Replies: 3
    Last Post: 2011-05-25, 19:05
  2. Themes
    By Severe in forum Streaming and Video
    Replies: 1
    Last Post: 2006-10-12, 15:33
  3. s 60 themes
    By mattz23 in forum Streaming and Video
    Replies: 0
    Last Post: 2006-10-11, 08:42
  4. Themes for N91
    By geoxis in forum Streaming and Video
    Replies: 0
    Last Post: 2005-12-21, 09:01
  5. 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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved