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;
Or (from the constructor)
this.Text = "MyForm";
Hope this helps?
Comments
-
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 toMyForm
?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 almost 11 yearsThere is no Text property in Properties of Form. Instread there are properties such as Name of file, Full Path, Action when building, etc..
-
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 almost 11 years@NurlanKenzhebekov you are mixed up with properties of
Form.cs
(File propeties). -
King King almost 11 years@Hexie the OP also wants to rename his
Form
, you miss that. -
Cody Gray almost 11 yearsNo 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 fromSystem.Windows.Forms.Control
have it. This answer is correct as it stands. -
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 almost 11 years@Hexie this question is made italic:
How do I rename this text to MyForm
whereasthis text
was mentioned before in... its default name is Form1 ...
-
King King almost 11 years@Hexie OK, it looks like that the OP even doesn't differentiate the
Name
and theText
of the form, he possibly wants to change theText
of his form.