PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: James Fuller on March 30, 2010, 12:09:02 PM

Title: combobox focus rectangle
Post by: James Fuller on March 30, 2010, 12:09:02 PM
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
Title: Re: combobox focus rectangle
Post by: Rolf Brandt on March 30, 2010, 01:13:59 PM
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 )

Title: Re: combobox focus rectangle
Post by: James Fuller on March 30, 2010, 02:27:38 PM
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

Title: Re: combobox focus rectangle
Post by: Rolf Brandt on March 30, 2010, 02:32:27 PM
Strange - I'll see if I can re-create this behaviour.
Title: Re: combobox focus rectangle
Post by: Rolf Brandt on March 30, 2010, 02:38:28 PM
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?
Title: Re: combobox focus rectangle
Post by: James Fuller on March 30, 2010, 03:16:38 PM
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
Title: Re: combobox focus rectangle
Post by: Roger Garstang on March 30, 2010, 05:59:13 PM
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]
Title: Re: combobox focus rectangle
Post by: James Fuller on March 30, 2010, 06:39:04 PM
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
Title: Re: combobox focus rectangle
Post by: James Fuller on March 30, 2010, 06:51:25 PM
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
Title: Re: combobox focus rectangle
Post by: Roger Garstang on March 31, 2010, 12:15:08 PM
Maybe in the SelChange event do a SetFocus on itself [SetFocus(hWndControl) in the function]