Print Page | Close Window

CXTPControlComboBox execute in OnKillFocus problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14276
Printed Date: 13 September 2025 at 2:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox execute in OnKillFocus problem
Posted By: xafier
Subject: CXTPControlComboBox execute in OnKillFocus problem
Date 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?



Replies:
Posted By: znakeeye
Date 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/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net