お世話になっております。
ここに質問の内容を詳しく書いてください。
Visual Studio 2012を用いて、WPFをC#で作ろうと思っています。
Windows10だとCheckBoxにチェック入れたときに表示されるのですが、Windows Server 2012だとCheck Boxにカーソルを合わせないとチェックが表示されません。
該当のソースコード
全体のソースコードからチェックボックスのところだけ抽出しました。 <!-- ********************************** CheckBoxStyle **********************************--> <Style x:Key="CheckBoxStyle" TargetType="CheckBox"> <Setter Property="Foreground" Value="{StaticResource ThemeForegroundBrush}"/> <Setter Property="HorizontalContentAlignment" Value="Left"/> <Setter Property="VerticalContentAlignment" Value="Top"/> <Setter Property="Padding" Value="4,1,0,0"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="CheckBox"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="18"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:0.2"/> </VisualStateGroup.Transitions> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hover" d:IsOptimized="True"/> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pressed" d:IsOptimized="True"/> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="disabled" d:IsOptimized="True"/> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="CheckStates"> <VisualState x:Name="Checked"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="checkBox" d:IsOptimized="True"/> </Storyboard> </VisualState> <VisualState x:Name="Unchecked"/> <VisualState x:Name="Indeterminate"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="IndeterminateIcon" d:IsOptimized="True"/> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="focused" d:IsOptimized="True"/> </Storyboard> </VisualState> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="ValidationStates"> <VisualState x:Name="Valid"/> <VisualState x:Name="InvalidUnfocused"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="invalidUnfocused" d:IsOptimized="True"/> </Storyboard> </VisualState> <VisualState x:Name="InvalidFocused"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="invalidFocused" d:IsOptimized="True"/> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Rectangle x:Name="normal" Opacity="1" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource CheckBoxBorderBrush}" StrokeThickness="1" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top" Fill="{StaticResource CheckBoxBackgroundBrush}"/> <Rectangle x:Name="hover" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource CheckBoxHoverBorderBrush}" StrokeThickness="1" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top" Fill="{StaticResource CheckBoxBackgroundBrush}" Opacity="0"/> <Rectangle x:Name="pressed" Opacity="0" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource CheckBoxFocusedBorderBrush}" StrokeThickness="1" Fill="{StaticResource CheckBoxBackgroundBrush}" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top"/> <Rectangle x:Name="focused" Opacity="0" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource CheckBoxFocusedBorderBrush}" StrokeThickness="1" Fill="{StaticResource CheckBoxBackgroundBrush}" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top"/> <Rectangle x:Name="disabled" Opacity="0" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource DisabledBorderBrush}" StrokeThickness="1" Fill="{StaticResource CheckBoxBackgroundBrush}" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top"/> <Rectangle x:Name="invalidUnfocused" Opacity="0" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource InvalidUnfocusedBrush}" StrokeThickness="1" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top" Fill="{StaticResource CheckBoxBackgroundBrush}"/> <Rectangle x:Name="invalidFocused" Opacity="0" Width="14" RadiusX="1" RadiusY="1" Stroke="{StaticResource InvalidFocusedBrush}" StrokeThickness="1" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top" Fill="{StaticResource CheckBoxBackgroundBrush}"/> <Rectangle x:Name="innerShadow" Width="14" StrokeThickness="1" HorizontalAlignment="Left" Margin="2,2,0,0" Height="14" VerticalAlignment="Top" RadiusX="0.5" RadiusY="0.5" Fill="{StaticResource CheckBoxInnerShadowBrush}"/> <Path x:Name="checkBox" Height="8" Width="10" Stretch="Fill" Opacity="0" Fill="{StaticResource CheckBoxGlyphBackgroundBrush}" HorizontalAlignment="Left" Data="M 1145.607177734375,430 C1145.607177734375,430 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1138,434.5538330078125 1138,434.5538330078125 1138,434.5538330078125 1141.482177734375,438 1141.482177734375,438 1141.482177734375,438 1141.96875,437.9375 1141.96875,437.9375 1141.96875,437.9375 1147,431.34619140625 1147,431.34619140625 1147,431.34619140625 1145.607177734375,430 1145.607177734375,430 z" Margin="4,5,0,0" UseLayoutRounding="False" VerticalAlignment="Top"/> <Rectangle x:Name="IndeterminateIcon" Fill="{StaticResource CheckBoxGlyphBackgroundBrush}" Height="6" Width="6" VerticalAlignment="Top" Margin="0,6,0,0" Opacity="0"/> <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
実行画面
Windows Server 2012の実行画面です。
画像が小さくてすみません。
わかりにくければ遠慮なくお願いします。よろしくお願いします。
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー