2012-04-18 4 views
1

버튼이 툴바에있는 경우 Button 텍스트의 색상을 변경할 수 있습니까? 툴바에서 버튼 텍스트 색상을 변경하는 방법은 무엇입니까?

은 내가 app.xaml

<Style TargetType="{x:Type Toolbar}"> <!-- this changes the background colour --> 
    <Setter Property="Background" Value="AliceBlue"/> <!-- works --> 
    <Setter Property="Foreground" Value="Red"/> <!-- doesn't work --> 
</Style> 

에 다음과 같은 노력하고 도구 모음은 다음과 같이 정의된다 나는

<Style TargetType="{x:Type Button}"> <!-- this changes both colours --> 
    <Setter Property="Background" Value="AliceBlue"/> <!-- works --> 
    <Setter Property="Foreground" Value="Red"/> <!-- work --> 
</Style> 

을 시도했다 :

<ToolBarTray Background="White" Width="Auto"> 
    <ToolBar UseLayoutRounding="True" > 
     <Button Content="Options" Name="btnOptionsSettings" Click="btnOptionsSettings_Click" ></Button> 
     <Button Content="Timer" Name="btnTimerSettings" Click="btnTimerSettings_Click" ></Button> 
     <Button Content="Blocks" Name="btnBlocks" Click="btnBlocks_Click" ></Butto 

    </ToolBar> 
</ToolBarTray> 
+0

답변을 찾았습니다 : http://stackoverflow.com/questions/3701263/c-sharp-wpf-how-to-modify-the-toolbar-buttonstylekey-style – DaveDev

답변

0

외부 스타일을 호출하여이 작업을 수행 할 수 있습니다 시트

관련 문제