Reputation: 327
I have a quick question. how do I change the name of form1 in my app? whenever I try to use the properties to rename it the form becomes broken and i cant use it anymore. is there a way to change it during run-time or am i doing something wrong with the properties? thanks.
Upvotes: 7
Views: 64550
Reputation: 7672
Change the Text
property of your form under the Properties panel, making sure that you've selected the form itself (and not some child control)
Upvotes: 8
Reputation: 1246
Use the Text property.
http://www.java2s.com/Tutorial/CSharp/0460__GUI-Windows-Forms/SetCaptiontitleoftheform.htm
Upvotes: 1
Reputation: 840
You can use Form.Text property to get/set the title of the form either in design time or at runtime depending upon your requirement. If you want to have a dynamic title that changes based on some events you can set it during the runtime for e.g. if you are showing the progress of a task in your form you will want to put the percentage completed in the title.
Upvotes: 1
Reputation: 2866
If you want to change the text of the window during runtime, use the Text property:
this.Text = "Title";
Upvotes: 18
Reputation: 36733
To change the name of your form, select it in the solution explorer and press F2. Then type in the new name for that form (don't forget the '.cs'!) and when you press enter it'll ask you if you want Visual Studio to update all references to that form. Click Yes, and you're done.
Upvotes: 1
Reputation: 15762
I believe you can just change the filename of the form to the one you want in design time.
Upvotes: 0