简体   繁体   中英

Making an MFC CTabCtrl not use the full control width for drawing tabs

We have a somewhat involved request for a change in our application, which is to make one of our tab controls only have access to part of the width of the control for the purposes of drawing the tabs, so that we can stick some additional status text in the remaining area on the side.

A picture would probably help:

复杂的UI请求

As you can see, the tab control extends all the way to the right of the dialog, but we want a reserved area for "Total Inventory Cost", and we want to make sure that additional tabs (which are common) don't encroach onto that area.

I'm open to pretty much any means of implementing this, short of completely rewriting the application. We can switch tab controls if there's one out there that works better, or otherwise change the implementation of the tab setup within reason.

I would have thought that one could separately set the client area and the tab drawing rectangle areas separately, but that doesn't seem to be the case. Please correct me if I'm wrong.

Any help appreciated!

If I understand correctly, what you've got is this

Main window's client area:

  • -> tab ctrl occupying the enttire area
  • -> some other controls on top of tab control

What you could do is this

Main window's client area:

  • -> Small tab control at the bottom
  • -> All othe controls in main window's client area

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM