C# 如何消除选项卡控件上的间隙?

C# 如何消除选项卡控件上的间隙?,c#,winforms,tabcontrol,C#,Winforms,Tabcontrol,有没有人知道如何避免TabControl上的页面和TabControl本身之间的左右间距分别为5-10 px。我什么都试过了。所有边距和焊盘均为零。一位愤怒的Microsoft程序员在TabPage的源代码中留下了一条注释: //HACK: to ensure that the tabpage draws correctly (the border will get clipped and // and gradient fill will match correctly wit

有没有人知道如何避免TabControl上的页面和TabControl本身之间的左右间距分别为5-10 px。我什么都试过了。所有边距和焊盘均为零。

一位愤怒的Microsoft程序员在TabPage的源代码中留下了一条注释:

    //HACK: to ensure that the tabpage draws correctly (the border will get clipped and
    // and gradient fill will match correctly with the tabcontrol).  Unfortunately, there is no good way to determine
    // the padding used on the tabpage.
    // I would like to use the following below, but GetMargins is busted in the theming API:
    //VisualStyleRenderer visualStyleRenderer = new VisualStyleRenderer(VisualStyleElement.Tab.Pane.Normal);
    //Padding themePadding = visualStyleRenderer.GetMargins(e.Graphics, MarginProperty.ContentMargins);

功劳:汉斯·帕桑:-

没有人知道或有什么问题?可能是ThanYou的复制品,维杰。我给我的VS付了很多钱,我不能做这么小的事情是不公平的。比方说,解决了。