Delphi风格的VCL TTrackBar:跟踪时隐藏焦点虚线矩形
使用 VCL 样式时,如何在选择/跟踪时隐藏 VCL TTrackBar 周围的焦点?使用 Delphi 11.1
这不起作用:
SendMessage(tb1.Handle, WM_UPDATEUISTATE, UIS_SET OR UISF_HIDEFOCUS, 0);
How can I hide the focus around a VCL TTrackBar when selected/while tracking, while using a VCL style? Using Delphi 11.1
This didn't work:
SendMessage(tb1.Handle, WM_UPDATEUISTATE, UIS_SET OR UISF_HIDEFOCUS, 0);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
做工作。
尽管肯定是这种情况:
虽然控制 焦点使焦点矩形暂时重新出现,直到失去焦点为止。
Note :我仅尝试使用样式启用它。
Using
does work.
Before
After
Although it is definitely the case that calling:
while the control has focus causes the focus rectangle to temporarily re-appear until it loses focus.
Note: I only tried it with styles enabled.
您可以通过将其
TabStop
属性设置为˙false`来防止ttrackbar
通过将其集中在焦点中。当您执行此操作时,将永远不会显示
ttrackbar
的虚线。好吧,唯一的例外是,如果您对形式没有其他可重点组件,那么当您开始与TrackBar进行交互时,虚线仍然会出现。
编辑:对:我忘记了VCL风格超越了许多其他物业。
您可以以某种方式修改VCL样式,以便禁用
focuseffect
ttrackbar
,然后使用此修改的样式。You can prevent
TTrackBar
from getting focused by setting itsTabStop
property to ˙False`.When you do this the the dotted line around
TTrackBar
won't ever be shown.Well the only exception is if you have no other focusable component on the form in which case the dotted line still appears when you start interacting with the trackbar.
EDIT: Right I forgot that VCL Styles override the said property amongst many others.
You could modify your VCL style in a way so you disable the
FocusEffect
forTTrackBar
and then use this modified style instead.