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.
[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]
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