I made a simple panel usercontrol, only a rectangle
containing one label but with the capability of fore- and
background colors, a very simple control which could rarely
be simpler. No big action.
When I use this control in a larger project, sometimes - and
only sometimes - I get an error at saving or compiling the
project because of usercontrol.scalewidth (and also
usercontrol.width) is zero and therefore the label's width
turns negative when computed as LBL.width =
UserControl.ScaleWidth-2*Screen.TWIPSPERPIXELX . In the host
application there is no resizing done which could lead to
widh=0, f.e. due to an error. According to that the IDE
shows no calling function when breaking down, only the
resize event where the width calculation is placed.
But why else can a usercontrol shrink to zero, and why
doesn't it occur only sometimes?