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:
I don't understand why VS restrict me to add local resource file of Form1.cs
.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With