forms - Visual Studio C# variable in properties -


is there functionality use global variable in form properties window?

public partial class mainform : form     {     string title = "this title";     // constructor,etc. } 

variable property

no, there isn't such functionality in designer. nearest can using resources. can't wire resources directly in designer (unless doing localization tricks), can edit designer.cs file , change:

this.mainform.text = "whatever"; 

for

this.mainform.text = properties.resources.mainformtitle; // or whatever other resource property wish 

this works resources (they considered global objects designer , respected upon serializing): if try set other variable (not resource-generated property), it'll overriden when form serialized again (upon saving).

otherwise, can set properties in constructor, after initializecomponents(), won't seen in design-time unless inheriting form.


Comments