In my Windows Phone App I want to have a TextBox which must be readOnly, but this makes its Foreground color look grayish, I want the Foreground color to be black, Is that possible?

Or how else can I have a textblock with black font, but not editable by the user?

有帮助吗?

解决方案

You can change the Style of your TextBox for the disabled state. To achieve this more easily, you can open your .xaml document in Expression Blend, Right Click in your TextBox -> Edit Template... -> Edit a Copy.

Then you choose the name you want for your Style. After that search for the States Tab, and click it. After that choose the disabled state. Then you can edit the TextBox to be whatever you like for the disabled state.

其他提示

Also you can just set TextBox Style to null, and set Foreground as usual.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top