Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPControlComboBox execute in OnKillFocus problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlComboBox execute in OnKillFocus problem

 Post Reply Post Reply
Author
Message
xafier View Drop Down
Newbie
Newbie


Joined: 02 April 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote xafier Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox execute in OnKillFocus problem
    Posted: 12 May 2009 at 11:15am
We have a CXTPControlComboBox on our ribbon that needs to perform an execute when it loses focus.

To do this I tried the following (RegionNameComboBox inherits from CXTPControlComboBox)

void RegionNameComboBox::OnKillFocus()
{
    OnExecute();
    CXTPControlComboBox::OnKillFocus();
}

The message fired by OnExecute is handled in our View class so this would now handle if the user presses enter or clicks off.

Unfortunately this has undesirable effects, as if the user clicks off the combobox edit onto the "Ribbon Home button" (the circle button) then the ribbon home button then gets stuck and locked and no longer works.

I am wondering what is the best way of implementing forcing an execute when losing focus which will not break the ribbon?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2009 at 3:14am
What happens if you swap the two calls? E.g. CXTPControlComboBox::OnKillFocus() before OnExecute().
 
Another solution would be this:
 
void RegionNameComboBox::OnKillFocus()
{
    CXTPControlComboBox::OnKillFocus();
    PostMessage(WM_COMMAND, ID_EXECUTE);
}
That should do it.
PokerMemento - http://www.pokermemento.com/
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.