Link to home
Start Free TrialLog in
Avatar of Crius
Crius

asked on

COXTabClientWnd custom CTabCtrl for MDI views

I'm using the control from http://www.codeproject.com/docview/tabbedmdi.asp

The problem is, when I start opening the child windows, the tabs build up to the point where they will no longer be able to fit in 1 row. At this point they split into two rows.

The problem is, the top row moves onto the top of the Main Frame window, and the second row stays on the bottom of the main frame window.

I want to keep all the tabs on the bottom of the main frame window.

On the above linked page is a sample program that does the exact same thing. All source is above too.

Summary: I'd like to prevent the tabs from being split up. How can I keep them all on 1 side of the main frame?
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Crius
Crius

ASKER

Ah, I had seen that argument, but didn't try it out. Strange.

All my solutions were trying this:

    VERIFY(m_MTIClientWnd.Attach(this));
    m_MTIClientWnd.GetTabCtrl()->ModifyStyle(0, TCS_MULTILINE|TCS_BOTTOM);


Very strange that the ModifyStyle wasn't working.

Thank you for the excellent help!

Yeah, I've asked 15 questions here, and only 4 (this included) have ever gotten answered. :) But I had spent 3 hours examining manuals and trying to modify the style with no success. TCS_MULTILINE and TCS_BOTTOM were around the first I tried too. Hehe. :)
There is something strange in that softwaare... I modified the #define that supposedly sets the "default" styles and it had no effect (I knew right away, because I set it to put the tabs on the top...)

-- Dan
Avatar of Crius

ASKER

Indeed. I simply thought I had the incorrect values in the ModifyStyle, but I did note that when I removed the TCS_BOTTOM in the ModifyStyle I mentioned above, that it did put the tabs on top. That's why I was assuming the ModifyStyle was working, and that I needed to do something more complicated.
Avatar of Crius

ASKER

I figured it out.

Those styles were already in there which is why adding them in didn't help in the ModifyStyle command. When you passed them in as you did, it did ONLY those styles which nuked the TCS_SCROLLOPPOSITE style. That is the style that needed to be removed. After removing that one style, the control behaved as I wished.
Avatar of Crius

ASKER

Now the solution is complete:

Right from the MSDN library:
Remarks
The following styles can be modified after the control is created:

TCS_BOTTOM
TCS_BUTTONS
TCS_FIXEDWIDTH
TCS_FLATBUTTONS
TCS_FORCEICONLEFT
TCS_FORCELABELLEFT
TCS_MULTILINE
TCS_OWNERDRAWFIXED
TCS_RAGGEDRIGHT
TCS_RIGHT
TCS_VERTICAL


TCS_SCROLLOPPOSITE is not listed. No wonder I could not remove it with ModifyStyle. It seems I did not read carefully enough, but then, yesterday was hectic with many emergencies I had to solve myself. Thank you for your help again! It was needed, especially since your help enabled me to figure out why my method was not working.