WPF 文本框边框

发布于 2024-08-14 19:15:20 字数 130 浏览 1 评论 0原文

我有一个想要验证的文本框,但是当我验证它时,无论我设置边框的方式如何,似乎实际上都包裹了我想要在文本框内更改的实际边框,即它在文本框外部添加了另一个边框。

有没有人有任何关于如何设置像素完美边框的示例,使其在活动中看起来不像裤子?

I have a textbox that I want to validate, but when I validate it and whatever way I am setting the border seems to actually wrap the actual border I want to change inside the textbox i.e. it adds another border outside the textbox.

Has anyone got any example of how to set a pixel perfect border that doesn't look pants on an event?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简单爱 2024-08-21 19:15:21

我没有给你的例子,但你可以这样做。

在 Silverlight 中,您可以覆盖 TextBox 样式,并且使用其中的验证控件和状态。

在 WPF 中,您可以使用 附加的 Validation.ErrorTemplate属性。您还可以查看 CodeProject 上的这篇文章:Validation in Windows Presentation Foundation

希望我正确理解你的意思:)。但我不知道“在活动中穿裤子”是什么意思 替代文本

I have no example for you, but here is what you can do.

In Silverlight you can override TextBox style, and play with validation controls and states in it.

In WPF you can play with Validation.ErrorTemplate Attached Property. Also you can look at this article on CodeProject: Validation in Windows Presentation Foundation

Hope I understood you properly :). But I don't know what does "look pants on an event" means alt text
.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文