如何改变在WinForms的标题栏文字? [英] How do you change the text in the Titlebar in winforms?
本文介绍了如何改变在WinForms的标题栏文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想设置将改变标题栏中写的一个条件。
但我怎么更改标题栏文字?
解决方案
您可以使用文本
属性<改变的WinForms标题栏中的文本/ p>
对于C#
//这类加入到含有命名空间Form1类。
类MainApplication
{
公共静态无效的主要()
{
//实例Form1的一个新实例。
Form1的F1 =新Form1的();
//显示一个消息框。这显示了应用程序
//正在运行,但存在向用户显示没有。
//这是指您自定义表单的地步。
System.Windows.Forms.MessageBox.Show(应用程序
+,现在正在运行,但没有形式已被证明);
//自定义表单。
f1.Text =运行表;
//显示模态窗体的实例。
f1.ShowDialog();
}
}
i am trying to set a condition that would change the writing inside the title bar..
But how do i change the title bar text?
解决方案
You can change the text in the titlebar in winforms by using the Text
property
For C#
// This class is added to the namespace containing the Form1 class.
class MainApplication
{
public static void Main()
{
// Instantiate a new instance of Form1.
Form1 f1 = new Form1();
// Display a messagebox. This shows the application
// is running, yet there is nothing shown to the user.
// This is the point at which you customize your form.
System.Windows.Forms.MessageBox.Show("The application "
+ "is running now, but no forms have been shown.");
// Customize the form.
f1.Text = "Running Form";
// Show the instance of the form modally.
f1.ShowDialog();
}
}
这篇关于如何改变在WinForms的标题栏文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文