Windows 8 and 8.1 Forums


Can not see text in TextBox when it is disabled

  1. #1


    Posts : 3
    Windows XP

    Can not see text in TextBox when it is disabled


    build a metro application (Windows 8 Release Preview) using Visual studio 2012 the application has only a text box and a button click on the button only Enable/Disable the text box when I disable it the text in it is not visible and when I enable it it is grayed out until it get a focus.

    Code:
    
    
    Code:
    namespace App2
    {
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
       public sealed partial class MainPage : Page
       {
         public MainPage()
         {
           this.InitializeComponent();
         }
    /// <summary>
    /// Invoked when this page is about to be displayed in a Frame.
    /// </summary>
    /// <param name="e">Event data that describes how this page was reached. The Parameter
    /// property is typically used to configure the page.</param>
       protected override void OnNavigatedTo(NavigationEventArgs e)
      {
      } 
      private void Button_Click_1(object sender, RoutedEventArgs e)
      {
        TextBox1.IsEnabled = !TextBox1.IsEnabled;
      }
     }
    }


    [XAML]
    <Page
    x:Class="App2.MainPage"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App2"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <TextBox Name="TextBox1" HorizontalAlignment="Left" Margin="401,90,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="100"/>
    <Button Content="Button" HorizontalAlignment="Left" Margin="409,181,0,0" VerticalAlignment="Top" Click="Button_Click_1"/>

    [/XAML]

      My System SpecsSystem Spec

  2. #2


    Posts : 636
    Windows 7/8


    Are you sure this is not correct behavior? Or are you asking if it is?

    This and a million other things may in fact be simply the way the Metro UI works. It is /completely/ different from the standard windows UI elements and behaviour we've gotten used to in the last 15 years.

    Is the documentation provided with the dev tool complete enough to explain the expected behavior for a text box?
      My System SpecsSystem Spec

  3. #3


    Posts : 3
    Windows XP


    I got an answer from Microsoft that this is the default behavior of a text box that the background and the text color is the same for a disabled TextBox very odd that a default behaviorof a control is buggy (Text can no be seen when it is disabled) I do not think any one needs this behavior.
      My System SpecsSystem Spec

  4. #4


    Posts : 636
    Windows 7/8


    Heh, that statement could be used in about 50 places when referring to something in the metro UI

    It's a completely new beast... need to figure out how best to use the new and and the odd. I agree though "Disabled" != "Hidden". That was (and should be) a separate state :/

    Now you may have to change the text color yourself and ignore input on it or something :/
      My System SpecsSystem Spec

Can not see text in TextBox when it is disabled
Related Threads
Disabled DELETE key in win 8.1 in General Support
Hi, I am using Lenovo Z400 previously pre installed win Win8. In an unknown reason the mouse clicks (left/right) suddenly began to start deleting whatever you point and click. Believing it was a virus, I fresh installed a Win 8.1. However, the mouse click errors still there. It still deletes...
Bluetooth Disabled in Drivers & Hardware
Had some issues with my HP Pavilion G6-2301AX. And i have original Windows 8 recovery CD i bought from HP. So I did the system recovery and after that my bluetooth is always disabled as shown in the attachment. With HP support assistant, I even updated the driver but its still the same. It works...
Solved Your account has been disabled in User Accounts and Family Safety
I tried to remove the "other user" screen, but while trying to do that I lost my admin credintals, so I tried to fix it by going on safe mode then I assigned a password to the administrator account... And now when I try to login it says "Your account has been disabled" Please help
http://i57.fastpic.ru/big/2013/1128/b1/97efdd53ea01e804d37ee8a89bb089b1.jpg Please guide me fix it.thanks
hello I use two main and important add-ons : lastpass and FDM (free download manager). I like to use windows 8 new interface (Metro) to surf the net with add-on & toolbar features.:geek: I am not much familiar with this new interface. The another problem with this new interface is that I...
Solved Disabled FN Keys? in Drivers & Hardware
After having my Asus K53E from Windows 7 to Windows 8, my FN Keys are suddenly not working, except for FN+F1~F2! (Sleep and internet respectively). I was wondering if someone can guide me how to fix this problem. I am using a mouse, and with my wrist resting on the bottom center of the laptop, I...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook