如何在Windows窗体的标题栏中更改文本? [英] How do you change the text in the Titlebar in Windows Forms?

查看:191
本文介绍了如何在Windows窗体的标题栏中更改文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图设置一个条件来更改标题栏中的文字...

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?

推荐答案

您可以使用 Text 在Windows窗体的标题栏中更改文本。属性。

You can change the text in the titlebar in Windows Forms by using the Text property.

// 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();
   }
}

这篇关于如何在Windows窗体的标题栏中更改文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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