2012-04-16 69 views

回答

1

您可以使用文本框和鼠標套裝彩色背景上

<TextBox TextWrapping="Wrap" Background="#FFBA2C2C" Height="20"> 
     <TextBox.Template> 
      <ControlTemplate> 
       <StackPanel Orientation="Horizontal"> 
        <VisualStateManager.VisualStateGroups> 
         <VisualStateGroup x:Name="CommonStates"> 
          <VisualState x:Name="Normal"/> 
          <VisualState x:Name="MouseOver"> 
           <Storyboard> 
            <ColorAnimation To="Red" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True" Duration="0"/> 
           </Storyboard> 
          </VisualState> 
         </VisualStateGroup> 
        </VisualStateManager.VisualStateGroups> 
        <TextBlock x:Name="textBlock" Text="Click Me"/> 
        </StackPanel> 
      </ControlTemplate> 
     </TextBox.Template> 
    </TextBox> 
+0

你好Smith.Patel非常感謝您的幫助,但我想要的東西,再次感謝 。 – 2012-04-17 14:58:49

相關問題