Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Form1.resx dont allow me to Edit/Add resources?

Tags:

c#

winforms

I add one Windows Form name as Form1.cs in my project and try to edit local resource file of same Form1.cs ( Form1.resx ) file, while editing VS pop up following confirmation box:

enter image description here

I don't understand why VS restrict me to add local resource file of Form1.cs.

like image 292
Ankush Madankar Avatar asked Sep 16 '25 11:09

Ankush Madankar


1 Answers

The form resource files (like Form1.resx) are serialized by VisualStudio. For this reason all manually added resources will be removed during design-time serialization. You should only edit resources in the resx file, which have already been added by the design time. Adding resources directly into the resx file will result in their deletion next time the form is changed (and has been subsequently serialized).

Solution:

Store all manually defined strings (or custom resources) in the application resources. By default, this file is Resources.resx and is located in the Properties folder in your application.

Source : http://www.telerik.com/support/kb/winforms/general/resources-in-form-s-resx-files-are-lost.aspx

like image 197
Anuraj Avatar answered Sep 18 '25 23:09

Anuraj