Can not see text in TextBox when it is disabled

Ofer

New Member
Messages
3
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:
[/B]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;
  }
 }
}
[B]

[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 Computer

System One

  • OS
    Windows XP
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 Computer

System One

  • OS
    Windows 7/8
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 Computer

System One

  • OS
    Windows XP
Heh, that statement could be used in about 50 places when referring to something in the metro UI :D

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 Computer

System One

  • OS
    Windows 7/8
Back
Top