In my Form class I have a variable int called BitmapSize.
I want to let the window automatically adjust to the bitmap so I tried setting the clientsize using this variable, BitmapSize.
I get the following warning (no error) when trying to the designer:
“To prevent possible data loss before loading the designer, the following errors must be resolved:
The variable ‘BitmapSize’ is either undeclared or was never assigned”
Can I just ignore this or is there a cleaner way of achieving what I want? (My code does work as intended..)
Put that at the end of the constructor or in the
OnLoadhandler, not inside the designer-generated function (InitializeComponentor whatever), and that will make the designer stop complaining.Generally mixing anything non-literal into the designer-managed code will confuse it.