SetFocus and KIllFocus

  • Thread starter Thread starter sgrm123
  • Start date Start date
S

sgrm123

Guest
Hi,

I have CMFCTabCtrl in my dialog.

My CMFCTabCTrl has two tabs.

The first tab has a ComboBox and the second tab also has a ComboBox.

Whatever item newly added in ComboBox in first tab will reflect in ComboBox in second tab similarly whatever a item newly added in ComboBoxin second tab will reflect in ComboBox in firsttab. For this I have all ComboBox items in a vector and in each dialog's wm_onsetfocus event I am adding items to ComboBox.

When user typing something in ComboBox but then user selects another control or dialog/tab also I am adding that item to ComboBox. For that I am tracking CBN_KILLFOCUS in parent's dialog OnCommand and adding the item to ComboBox.

Now my problem is when user type something in ComboBox and clicking on second tab, the SetFocus of second tab is called first and then only OnCommand with CBN_KILLFOCUS () message is getting called so the second tab is not having newly added item by the first tab whereas the first tab is having that item.

How to make the ComboBox item available to the second tab before it is getting displayed.

Thanks.

Continue reading...
 
Back
Top