[英]MFC: How do you Paint a CTabView Background When no tabs exist?
I what to display some text, probably using DrawText()
on to the CTabView
client area when no tabs exist to explain why they don't exist.我想显示一些文本,可能在没有选项卡时在
CTabView
客户区使用DrawText()
来解释它们不存在的原因。 However, CTabView::OnPaint()
is not called except once at the app startup.但是,
CTabView::OnPaint()
不会被调用,除非在应用程序启动时调用一次。 Also when all tabs hidden the CTabView::OnDraw()
is not called.此外,当所有选项卡隐藏时,不会调用
CTabView::OnDraw()
。 I suppose the CMFCTabCtrl
may be the one getting the OnPaint()
callbacks?我想
CMFCTabCtrl
可能是获得OnPaint()
回调的那个? But nonetheless, how do you output something to that row/col of a CSplitterWnd
occupied by a CTabView
when all tabs are not shown (hidden via CMFCTabCtrl::ShowTab()
).但是,当所有选项卡未显示(通过
CMFCTabCtrl::ShowTab()
隐藏)时,您如何将某些内容输出到CTabView
占用的CSplitterWnd
那一行/列。 ?? ??
TIA!!蒂亚!!
The tab control works that way that all tab views are hidden - except the one which is open.选项卡控件的工作方式是隐藏所有选项卡视图 - 除了打开的选项卡视图。
Where no tab view is open, none will receive a paint message (nor WM_ERASEBACKGROUND).如果没有打开选项卡视图,则不会收到绘制消息(也没有 WM_ERASEBACKGROUND)。
You could try implementing your paint stuff in the tab control's OnPaint handler.您可以尝试在选项卡控件的 OnPaint 处理程序中实现您的绘画内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.