Hi there,
I'd like to re-create a form given only its resource file. I was going to
simply read the resource file and re-create the "Form" object and all its
controls as found in this file (applying all properties in the file and
relying on the default properties for those not found). After looking at
"InitializeComp onent()" however (which is what I'm really trying to
re-produce here), can somone explain why this function does the following:
1) Manually sets the "Name" property for each control which overwrites the
same property found in the resource file itself (athough the names are the
same - it should rely solely on the resource file however). E.g., I see this
in code *after* reading the same value from the resource file:
this.MyButton.N ame = "MyButtonNa me";
2) Occasionally adds other properties in code such as:
this.MyButton.U seVisualStyleba ckColor = true
this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
etc.
How is anyone supposed to to know to apply the above properties and possibly
others when all you have is the resource file to work with? Moreover, is
there a more appropriate (official) way to generate a form from its resource
file (manually doing it is tedious and error prone). Thanks.