关于tabcontrol的问题 [英] a question about tabcontrol

查看:114
本文介绍了关于tabcontrol的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tabcontrol包含选项卡和标签页。

如何设置标签页宽度?

the tabcontrol contains tab and tabpage.
how to set tabpage width?

set the property of tabpage size ,but it can't vali.
how can i do?

推荐答案

你不能设置TabPage的宽度:它的大小是确定的通过TabControl的大小偏移TabControl为其边框和Tabs消耗的区域。



如果你把一个名为'TheTabControl的TabControl放在WinForm上并执行此代码一些方法或EventHandler:



Console.WriteLine(TheTabControl.Bounds);

Console.WriteLine(TheTabControl.DisplayRectangle);



Console.WriteLine(TheTabControl.TabPages [0] .Bounds);

Console.WriteLine(TheTabControl.TabPages [0] .DisplayRectangle);



你可以看到TabControl的总大小和TabPage之间的差异,以及可用区域的大小,你会看到Bounds of Bounds of TabPage与TabControl的DisplayRectangle相同。注意:在每种情况下,'ClientRectangle属性都与'DisplayRectangle属性相同。
You can't set a TabPage's width: its size is determined by the TabControl's size offset by the areas consumed by the TabControl for its borders and Tabs.

If you put a TabControl named 'TheTabControl on a WinForm and execute this code in some method or EventHandler:

Console.WriteLine(TheTabControl.Bounds);
Console.WriteLine(TheTabControl.DisplayRectangle);

Console.WriteLine(TheTabControl.TabPages[0].Bounds);
Console.WriteLine(TheTabControl.TabPages[0].DisplayRectangle);

You can see the difference between the total size of the TabControl, and TabPage, and the size of the area available for use, and you'll see that the Bounds of the TabPage is the same as the DisplayRectangle of the TabControl. Note: in each case here the 'ClientRectangle property would be the same as the 'DisplayRectangle property.


标签页的大小由标签控件的大小定义;页面占用所有可用空间以一次显示选项卡和一个页面。您可以在页面上放置较小尺寸的子控件。如果您需要其他一些行为,则需要创建自定义控件。



-SA
The size of a tab page is defined by the size of a tab control; the page occupies all available space to show tabs and one page at a time. You can put a child control of smaller size on a page. If you need some other behavior, you will need to create a custom control.

—SA


这篇关于关于tabcontrol的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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