Why Resource (.resx) file added on merely changing Form size and on adding button which is not resource
1- Resource files suppose to be added on adding some resource in application like image or audio or video etc. But if I just change size of form a .resx file incleded under that particular form. Changing size of form does not add any resource so why this .resx file?
2- I dropped a button on form and a resource file is included; again this button is not some kind of resource, it is object having its creation information in designer file?
3- A resource file added on dropping button on form but if I delete this resource file and run application it compile and run with NO error and button is still there. If this button has any relation with resource file then there must by some kind of compile or runtime error AND if .resx file has nothing to do with button then why it was added?
I am using VS 2008.
EDIT: I have added a picture box and added an image in this now this is resource. i deleted the From1.resx file and I was expecting an error开发者_开发百科 but NO ERROR AGAIN. In designer file picturebox referring image from properties folder which has Resources.resx file. Double click on this and image is there. SO WHAT WAS THE PURPOSE OF From1.resx FILE?
Thanks in advance for the help
AFAIK there isn't a strict requirement, but it is probably one of those things where it is simpler (read: less brittle, more predictable, cheaper to implement, whatever) to generate the resx if there is even the suggestion that one could possibly be required (even if it turns out to be trivial) than it is to fully track the nuances of when one is absolutely demanded.
I agree; in the scenario you describe no resx is required, but it isn't going to upset me.
(it still happens in VS2010, btw - but then I suspect you shouldn't hope for much change to winforms in VS2010)
It seems that the resx file for that form is most likely tied to localization. I.e. For localizing Text content such as the text on the button. When you add a resource such as an image file by default it is placed in the applications resx file that is located in the My Project folder. So if you have the form or projects language set I think that it will always create a local resx file for that form when you add a control that could be localized.
精彩评论