简体   繁体   English

使MFC CTabCtrl不使用绘图选项卡的完整控件宽度

[英]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 - > tab ctrl占用了入口区域
  • -> 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 - >主窗口客户区中的所有其他控件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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