Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人对如何从 silverlight 文本框中删除焦点矩形有任何想法吗?(我说的是当您单击 texblock 开始输入时出现的蓝色矩形)
我正在查看文本框的默认样式和模板,但似乎无法确定要调整哪个元素。
谢谢!
在模板中,您会发现一个名为FocusVisualElement. 在基础和未聚焦视觉状态下,它的不透明度为 0%。在聚焦视觉状态下,它具有 100% 的不透明度。如果您不想要任何指示焦点的边框,您可以简单地删除 FocusVisualElement。
FocusVisualElement
当 MouseOverBorder 仍然出现时,这可能看起来很奇怪,因此您可能也想从模板中删除它,但是首先将它持有的 ContentElement 移动到父 Grid。
或者,您可以将所有州的这些边界的不透明度设置为 0%。