I have some checkboxes with no caption, but when they have the focus, they draw a focus ring around the space where the caption would go assuming it’s left justified. Looks pretty ugly:
Ideally I would like the checkbox itself to be surrounded by the focus ring in a square shape, so that my form can be controlled with the keyboard alone, like this (VERY crude mock-up):
What’s the best way to resolve this?
WM_CHANGEUISTATE looks like could be what is needed… Perhaps someone who knows more about Windows declares can help you…
A little more info, this is a new problem in Xojo 2018. In 2017R3 and before, if the width of a checkbox was 20 and there was no caption it would not draw a focus ring.
I have attempted to hide the focus ring using @shao sean 's suggestion and the SendMessage API but it didn’t have any effect unless I’m doing something wrong:
[code]Public Sub HideFocusRing(hWnd as int32)
Declare Sub SendMessage Lib “User32.dll” Alias “SendMessageA” (hWnd as Int32, msg as Int32, wParam as Int32, lParam as Int32)
dim WM_ChangeUIState as int32 = &H127
dim UIS_HideRectangle as int32 = &H1
dim UIS_ShowRectangle as int32 = &H2
dim UISF_FocusRectangle as int32 = &H1
'Combine low and high words
dim P as int32 = UIS_HideRectangle * &H10000 + UISF_FocusRectangle
SendMessage hWnd, WM_ChangeUIState, P, 0
Feedback Case #52537, by the way.