Change Caption causes Focus problem |
Post Reply |
Author | |
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
Posted: 20 February 2008 at 10:36am |
I have ran into a situation when if I change the caption of a Menu/Toolbar it causes the current window to lose focus.
Do to my requirements we need to change the Caption and Tooltip of a Menu/Toolbar control depending on the current state of an item in the list box. However, as soon as we change the caption, that list box loses focus so the user is no longer able to arrow up/down without click back in the list box. Is there a way to change the caption text without triggering this focus issue? |
|
cgaskill
Newbie Joined: 13 April 2006 Location: United States Status: Offline Points: 15 |
Post Options
Thanks(0)
|
The following work around worked for my situation.
Dim hwndFocus As Long hwndFocus = GetFocus() ' Win32 API call Control.Caption = 'New Caption' CommandBars.RecalcLayout If hwndFocus > 0 Then Call SetFocus(hwndFocus) ' Win32 API call EndIf |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |