Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在silverlight 5中更改只读文本框中的背景色?_Silverlight_Silverlight 4.0_Silverlight 3.0_Silverlight 5.0_Silverlight Toolkit - Fatal编程技术网

如何在silverlight 5中更改只读文本框中的背景色?

如何在silverlight 5中更改只读文本框中的背景色?,silverlight,silverlight-4.0,silverlight-3.0,silverlight-5.0,silverlight-toolkit,Silverlight,Silverlight 4.0,Silverlight 3.0,Silverlight 5.0,Silverlight Toolkit,我想更改只读文本框的颜色 可以将默认颜色更改为白色 <Style TargetType="TextBox"> <Setter Property="Background" Value="White"/> <Setter Property="Foreground" Value="Black"/> </Style> 和文本

我想更改只读文本框的颜色

可以将默认颜色更改为白色

<Style TargetType="TextBox">
            <Setter Property="Background"
                Value="White"/>
            <Setter Property="Foreground"
                Value="Black"/>
        </Style>

和文本框作为

<TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" Height="18" Padding="0" IsReadOnly="True" Margin="3,0,3,0"/>


提前感谢

问题不是背景设置程序不工作,而是文本框的只读状态有灰色覆盖

这里有两个选项:

  • 在Expression Blend中编辑文本框的控件模板,并去掉覆盖
  • IsReadOnly设置为false并将ishittevisible设置为false,这将防止编辑文本框而不改变其视觉状态

  • 是的,我检查此链接,我注意到我可以将颜色更改为白色,以便回复,但当我设置IsHitTextVisible=true和IsReadOnly=false时,则是可编辑的文本框,但我不想给出可编辑的文本框如果IshittetVisible为false,则文本框无法聚焦,因此无法编辑…谢谢。。你刚刚把我从xaml+c的麻烦中解救出来#