I was playing with the ComponentResourceManager in a small test application because I need to fix the localization that was formerly automatically generated in an existing, larger, Winforms app to be manually implemented--so that all of the strings that were manually inserted into the resource files don't get nuked whenever someone opens the form designer.
For the sake of this test, on the form there is a button control. I want to set button properties using ones stored in a resource file. If I seek the properties and set them directly, this works fine.
ResourceManager resourceManager = new ResourceManager("LocalizationTest1.buttonProps", typeof(Form1).Assembly);
button1.Text = resourceManager.GetString("button1.Text");
button1.Location = (Point)(resourceManager.GetObject("button1.Location"));
However, attempting to use ApplyResources, as follows, does not work.
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Form1));
componentResourceManager.ApplyResources(this.button1, "button1");
It may also be relevant that the resource names button1.Text and button1.Location both have the resource name 'button1...' is not a valid identifier
next to them in the resource designer.
I haven't been able to find anything relevant online thus far, so any thoughts that may be of assistance would be greatly appreciated.