Solved

COXTabClientWnd custom CTabCtrl for MDI views

Posted on 2002-03-07
6
602 Views
Last Modified: 2013-11-20
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?
0
Comment
Question by:Crius
  • 4
  • 2
6 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 6849989
Your questions are rarely so easy Cirus.  

In the demo project, change the line that says :

     VERIFY(m_MTIClientWnd.Attach(this));
to

     VERIFY(m_MTIClientWnd.Attach(this, TCS_MULTILINE|TCS_BOTTOM ));  // |TCS_HOTTRACK|TCS_SCROLLOPPOSITE|TCS_RIGHTJUSTIFY

-- Dan
0
 
LVL 3

Author Comment

by:Crius
ID: 6850941
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. :)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6851323
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
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 3

Author Comment

by:Crius
ID: 6851360
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.
0
 
LVL 3

Author Comment

by:Crius
ID: 6851376
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.
0
 
LVL 3

Author Comment

by:Crius
ID: 6851420
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now