Click to See Complete Forum and Search --> : Hiliting a control?


Gyannea
November 13th, 2003, 05:15 AM
I have a bunch of radio buttons and when I click on them the button gets marked and all that. However, if I use the keyboard, they are hilited even more. A dotted rectangle encompasses the text. If I then use the mouse to click other buttons, the dotted rectangle follows.

How do I get that dotted (or dashed) rectangle to appear around the desired radio button without user intervention? I have tried "SetFocus()" and that doesn't work. Neither does sending a BM_CLICK message. Would I have to send a WM_KEYDOWN, WM_KEYUP arrow-key message sequence to the desired button? Probably the previous button (yuulk)?

What I want to do is guide the user to the proper control after an error. In this case the user composes a radio call that has many components. One of the features of the call is not done and I want to direct the user to the correct control for the fix. Wish I could make it light up!

Thanks,

Brian

Sam Hobbs
November 13th, 2003, 10:14 AM
You can use Spy++ to see what messages are sent to the control.

If you want to get the user's attention, you could use FlashWindow().

Gyannea
November 13th, 2003, 10:44 AM
Sam,

All I wanted to do was to bring attention to a control. It has no title bar so the FlashWindow options didn't do anything. However, it would be perfect if it did, because that's just what I want. I bring the keyboard focus to the control but it is not obvious in a almost full screen dialog box with more than 70 controls!

Brian

Sam Hobbs
November 13th, 2003, 11:05 AM
If FlashWindow does not work when there is no title bar then I apologize for wasting your time. However note that a "flash" requires at least two calls. The documentation is not easy to understand; I have had to play with the function a bit to figure it out. To get a flash, we must use a timer to return a window to its original state. If you do two FlashWindow calls without a delay between them then you are not likely to see anything.

PerryBruins
November 19th, 2003, 02:03 PM
Hi,

If you implement the ownerdraw mechanism for your radiobutton control, you can change e.g. the text to bold, or change the color of the text.

regards, perry