Rename title of WinForms form

23,270

You would need to change the Form's Text property;

This can be done VIA the properties or within code;

enter image description here

Or (from the constructor)

this.Text = "MyForm";

Hope this helps?

Share:
23,270
Nurlan
Author by

Nurlan

java, c++, c#

Updated on December 16, 2020

Comments

  • Nurlan
    Nurlan over 3 years

    How do I rename the name of already created Windows Form? Currently, its default name is Form1 and when the application runs its name is shown in the top-left side of window. How do I rename this text to MyForm?

    Refactoring changes the name of the .cs files, but the text in window does not change. Moreover, I tried to change default icon of the form by using Project->Properties->Browse to the location of the .ico file, but the default icon didn't change. Why doesn't that work?

  • Nurlan
    Nurlan almost 11 years
    There is no Text property in Properties of Form. Instread there are properties such as Name of file, Full Path, Action when building, etc..
  • Hexie
    Hexie almost 11 years
    @NurlanKenzhebekov Then I think you're looking in the wrong place, have you tried (from your Form1's constructor) to change it VIA code? (i.e. this.Text = "MyForm";)
  • King King
    King King almost 11 years
    @NurlanKenzhebekov you are mixed up with properties of Form.cs (File propeties).
  • King King
    King King almost 11 years
    @Hexie the OP also wants to rename his Form, you miss that.
  • Cody Gray
    Cody Gray almost 11 years
    No he doesn't. He wants to change the text displayed in the title bar. That's set by the Text property. All objects that inherit from System.Windows.Forms.Control have it. This answer is correct as it stands.
  • Hexie
    Hexie almost 11 years
    @KingKing Also - the question reads: Refactoring changes the name of the .cs files, but the text in window does not change. making it sound as if he has already changed the Form's name. I agree with Cody Gray unfortunately.
  • King King
    King King almost 11 years
    @Hexie this question is made italic: How do I rename this text to MyForm whereas this text was mentioned before in ... its default name is Form1 ...
  • King King
    King King almost 11 years
    @Hexie OK, it looks like that the OP even doesn't differentiate the Name and the Text of the form, he possibly wants to change the Text of his form.