Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMFCOutlookBarTabCtrl::SetActiveTab not working

Tags:

mfc

I have added a CMFCOutlookBar control to a dialog. This outlookbar contains some 12 trees.

As per following link https://msdn.microsoft.com/en-us/library/bb983453.aspx we can set active tab (in my case tree control) of our wish.

but it doesn't seems to work.

as per above link this function returns non zero value on success. Indeed it is returning 1 when i used it to set tree of my choice. but visually it's not changed.

can someone help me?

like image 718
Yogesh Avatar asked May 20 '26 13:05

Yogesh


1 Answers

Problem solved. CMFCOutlookBarTabCtrl::SetActiveTab() only works after window has been displayed. I guess this is because CMFCOutlookBar stores it's previous state to registory and reloads on next run. And this overrides changes made by SetActiveTab(), if we use it before displaying of window.

like image 183
Yogesh Avatar answered May 25 '26 02:05

Yogesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!