本文介绍了如何更改选项卡控件的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 C# WinForms 应用程序中使用选项卡控件.我想更改选项卡的标题.默认情况下,它们是 tabPage1、tabPage2 等.

I am using a Tab Control in a C# WinForms application. I want to change the title of the tabs. By default they are tabPage1, tabPage2, etc.

推荐答案

您可以在设计器中非常简单地更改它;点击标签页内容中的空白区域,使用属性视图设置Text属性.也通过代码通过:

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:

tabPage1.Text = @"Something Meaningful";

其中 tabPage1 将是对您想要设置 Text 的任何 TabPage 的引用.

Where tabPage1 would be the reference to whichever TabPage you wanted to set the Text of.

这篇关于如何更改选项卡控件的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 23:08
查看更多