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);
CodePudding user response:
Using
SendMessage(tb1.Handle, WM_UPDATEUISTATE, UIS_CLEAR OR UISF_HIDEFOCUS, 0);
does work.
Before
After
Although it is definitely the case that calling:
SendMessage(tb1.Handle, WM_UPDATEUISTATE, UIS_CLEAR OR UISF_HIDEFOCUS, 0);
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.
CodePudding user response:
You can prevent TTrackBar
from getting focused by setting its TabStop
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.