如何使用.NET TextBoxRenderer和TextBoxState.Hot来绘制热文本框?
我正在尝试使用 TextBoxRenderer
渲染“热”文本框:
TextBoxRenderer.DrawTextBox(e.Graphics, rectangle, TextBoxState.Hot);
除了它不起作用之外,它不会将文本框渲染为热。
TextBoxState.Selected
不会呈现为选定的TextBoxState.Hot
不会呈现为热门
如何使 TextBoxRenderer.DrawTextBox(..., Hot)
渲染为 Hot
?
相关但不同的问题:
How do i make TextBoxRenderer.DrawTextBox(..., Selected)
render as Selected
?
i am trying to use TextBoxRenderer
to render a "hot" text box:
TextBoxRenderer.DrawTextBox(e.Graphics, rectangle, TextBoxState.Hot);
except that it doesn't work, it doesn't render the text box as hot.
TextBoxState.Selected
doesn't render as selectedTextBoxState.Hot
doesn't render as hot
How do i make TextBoxRenderer.DrawTextBox(..., Hot)
render as Hot
?
Related but different question:
How do i make TextBoxRenderer.DrawTextBox(..., Selected)
render as Selected
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来
TextBoxRenderer
使用EP_BACKGROUNDWITHBORDER
,而EP_EDITBORDER_NOSCROLL
通常由TextBox
控件使用[1]。(尝试从
VisualStyleElement
获取元素很诱人,但EP_EDITBORDER_NOSCROLL
没有嵌套类。所以是数字常量 6 和 3。)It seems that
TextBoxRenderer
usesEP_BACKGROUNDWITHBORDER
, whereasEP_EDITBORDER_NOSCROLL
is typically used byTextBox
controls[1].(It's tempting to try to get the element from
VisualStyleElement
but there's no nested class forEP_EDITBORDER_NOSCROLL
. So numeric constants 6 and 3 it is.)