[英]how to change the name of the tabcontrol
您可以在设计器中非常简单地更改它; 点击标签页内容中的空白区域,使用属性视图设置Text
属性。 也通过代码通过:
tabPage1.Text = @"Something Meaningful";
其中tabPage1
将是对您想要设置Text
的任何TabPage
的引用。
tabCtrl.TabPages[0].Text = "some text";
tabCtrl.TabPages[1].Text = "some other text";
进入designer.cs ,您可以像这样更改标签文本this.tabPage3.Text = 'Your Title'
方法
//Component Designer generated code
private void InitializeComponent()
{
...
this.tabControl1 = new System.Windows.Forms.TabControl();
...
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
...
this.tabPage3.Text = "tabPage3";//change the tab name
...
}
它将自动刷新设计视图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.