private HorizontalAlignment alignment = HorizontalAlignment.Left;
private StatusBarPanelAutoSize auto_size = StatusBarPanelAutoSize.None;
private StatusBarPanelBorderStyle border_style = StatusBarPanelBorderStyle.Sunken;
- private StatusBarPanelStyle style;
+ private StatusBarPanelStyle style = StatusBarPanelStyle.Text;
private int width = 100;
- private int twidth = -1;
private int min_width = 10;
internal int X;
#endregion // Local Variables
[RefreshProperties(RefreshProperties.All)]
public int MinWidth {
get {
- if (AutoSize == StatusBarPanelAutoSize.None)
- return Width;
+ /*
+ MSDN says that when AutoSize = None then MinWidth is automatically
+ set to Width, but neither v1.1 nor v2.0 behave that way.
+ */
return min_width;
}
set {
if (value < 0)
throw new ArgumentException ("value");
min_width = value;
+ if (min_width > width)
+ width = min_width;
+
Invalidate ();
}
}
throw new ArgumentException ("value");
if (initializing)
- twidth = value;
- else
width = value;
-
+ else
+ SetWidth(value);
+
Invalidate ();
}
}
internal void SetWidth (int width)
{
this.width = width;
+ if (min_width > this.width)
+ this.width = min_width;
}
public override string ToString ()
{
}
- public virtual void BeginInit ()
+ public void BeginInit ()
{
initializing = true;
}
- public virtual void EndInit ()
+ public void EndInit ()
{
- if (!initializing || twidth == -1)
+ if (!initializing)
return;
-
- width = twidth;
- twidth = -1;
+
+ if (min_width > width)
+ width = min_width;
+
initializing = false;
}
}