我注意到当我给它一个背景颜色时,光标消失了。虽然这不是我想要的,但它会使光标消失。我在 8.1 工作。例子:
<TextBox Style="{StaticResource _textBoxStyle1}"
Text="{Binding AddRow.Code, Mode=TwoWay}"
Width="220"
BorderThickness="0"
Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="10,0"
Background="#40FFFFFF"
Foreground="BurlyWood"/>
<Style TargetType="TextBox" x:Key="_textBoxStyle1" >
<Setter Property="FontFamily" Value="{StaticResource _standardFont}" />
<Setter Property="FontSize" Value="30" />
<Setter Property="Height" Value="38" />
<Setter Property="Foreground" Value="BurlyWood" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
</Style>
<x:String x:Key="_standardFont">Arial</x:String>