C# 如何更改选项卡控件的名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1617251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 19:26:01 来源:igfitidea点击:
how to change the name of the tabcontrol
提问by Surya sasidhar
采纳答案by Quintin Robinson
You can change it pretty simply in the designer; click on a blank area in the tab page contents and use the property view to set the Text
property. Also through code via:
您可以在设计器中非常简单地更改它;点击标签页内容中的空白区域,使用属性视图设置Text
属性。也通过代码通过:
tabPage1.Text = @"Something Meaningful";
Where tabPage1
would be the reference to whichever TabPage
you wanted to set the Text
of.
你想设置的tabPage1
引用在哪里。TabPage
Text
回答by Andrew Keith
tabCtrl.TabPages[0].Text = "some text";
tabCtrl.TabPages[1].Text = "some other text";
回答by Benkax
A lazy way to do it without code:
一种没有代码的懒惰方法:
- Select the tab control
- 选择选项卡控件
- Go to properties, use F4to do so
- Select TabPagesproperty, use F4to do so
- Click the ...after the
(Collection)
.
- 转到属性,使用F4这样做
- 选择TabPages属性,用于F4执行此操作
- 单击...之后的
(Collection)
。
- Edit the name and any
tabPage
properties associated with it.
- 编辑名称和
tabPage
与之关联的任何属性。