在TabControl中删除TabPage标题上的虚线矩形 [英] Remove Dashed Rectangle on the header of TabPage in a TabControl

查看:214
本文介绍了在TabControl中删除TabPage标题上的虚线矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。

我有一个表格作为主要表格,里面有一个TabControl。 TabControl中会有很多Tabs。在正常情况下,当我点击一个标签时,所选标签的标题文本周围会有一个虚线矩形。

我的老板认为如果虚线矩形消失,它看起来会更好。我怎么能做到?

Hello.
I have a form as main form with a TabControl in it. There will be many Tabs in the TabControl. In the normal situation, when I clicked on a Tab, there will be a dashed rectangle around the header text of the selected Tab.
My boss thinks it would be looking better if the dashed rectangle disappears. How could I make it?

推荐答案

你可以覆盖标签的drawitem事件......这里有一个类似的链接http://www.vb-helper.com/howto_net_ownerdraw_tab.html [ ^ ]



或者您可以立即将焦点移动到另一个控件,例如第一个控件在选定的选项卡上...另一个例子 http:// stackoverflow .com / questions / 4044711 / select-tab-page-in-tabcontrol-without-stealing-focus [ ^ ]



有几篇热门文章CodeProject上也可能为您提供更多帮助...

绘画您自己的标签 [ ^ ]和绘制自己的标签 - 第二版 [ ^ ]
You could override the tab's drawitem event...Here's a link to something similar http://www.vb-helper.com/howto_net_ownerdraw_tab.html[^]

Or you could immediately move the focus to another control, e.g. first control on the selected tab ... another example http://stackoverflow.com/questions/4044711/select-tab-page-in-tabcontrol-without-stealing-focus[^]

There's a couple of popular articles here on CodeProject that might give you more help too...
Painting Your Own Tabs[^] and Painting Your Own Tabs - Second Edition[^]


这篇关于在TabControl中删除TabPage标题上的虚线矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆