This is probably a duh.... but how does one get the focus rectangle to show after selecting an item in a combobox for that combo. I can get it if I keyboard TAB but I want it to show after a an initial selection.
James
Can you explain that a little better, James? If you select an item in a combobox it will show the focus rectangle because the combobox has the focus then.
Or do you mean if you set the item programatically? In that case you would use something like this:
FF_ComboBox_SetCurSel( HWND_FORM1_COMBO1, 2 )
FF_Control_SetFocus( HWND_FORM1_COMBO1 )
No. When I click on a combo and make a selection I am NOT seeing the focus rectangle until I hit the tab key.
I have three combos on a form and none show the focus rectangle if I just click. I need to use the keyboard.
Could it be possible because they are sitting on a label??
In the jpg I have just made a selection by using the mouse.
James
Strange - I'll see if I can re-create this behaviour.
That's what my combobox looks like when I selected an item.
Do you maybe have something in your code that shifts the focus to another control?
Here is a test project. I do not get a focus rectangle by just clicking. I have to hit the tab key just once then when I click a control I get the focus rectangle. I am using themes on Win7(64).
James
Perhaps it is a Vista/Win7 theme thing? Those combos almost look Linux-Like...I actually installed Linux on my laptop due to this since everything behaved and was drawn different anyway I figured I might as well switch. Could be tied into an effect something like hiding underline letters until Alt is pressed too where you have to hit Tab before focus is drawn. Your example for me shows highlight and dotted focus rectangle on clicking and selecting an item (Win XP 64bit). [It looks like what Rolf posted but with dotted rectangle...his may have had dotted too but lost focus on taking the screenshot]
Well I thought it might be that. Maybe there is a way to simulate the tab key to force the showing?
This is what it looks like with the focus
James
Yes it is a theme's thing. I turned it off and I get the blue plus the focus rectangle. Still looking for a workaround as I do like the theme look
James
Maybe in the SelChange event do a SetFocus on itself [SetFocus(hWndControl) in the function]