Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/System.Windows.Forms/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
override System.Windows.Forms.StatusStrip.DisplayRectangle.get -> System.Drawing.Rectangle
static System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode systemColorMode) -> void
static System.Windows.Forms.TaskDialog.ShowDialogAsync(nint hwndOwner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task<System.Windows.Forms.TaskDialogButton!>!
static System.Windows.Forms.TaskDialog.ShowDialogAsync(System.Windows.Forms.IWin32Window! owner, System.Windows.Forms.TaskDialogPage! page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner) -> System.Threading.Tasks.Task<System.Windows.Forms.TaskDialogButton!>!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,39 @@ internal override Size GetPreferredSizeCore(Size proposedSize)
return base.GetPreferredSizeCore(proposedSize);
}

/// <summary>
/// Returns the client rect of the display area of the control.
/// When SizingGrip is enabled, `DisplayRectangle` excludes the sizing grip width.
/// </summary>
public override Rectangle DisplayRectangle
{
get
{
Rectangle rectangle = base.DisplayRectangle;

if (!SizingGrip)
{
return rectangle;
}

Rectangle grip = SizeGripBounds;
int remainingWidth = rectangle.Width - grip.Width;
if (grip.IsEmpty || remainingWidth <= 0)
{
return rectangle;
}

if (RightToLeft == RightToLeft.Yes)
{
rectangle.X += grip.Width;
}

rectangle.Width = remainingWidth;

return rectangle;
}
}

protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static ToolStripItem CreateStatusStripItem()
return new ToolStripStatusLabel()
{
AutoSize = false,
Size = new Size(50, 25)
Size = new Size(40, 25)
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void StatusStrip_Ctor_Default()
Assert.False(control.DesignMode);
Assert.Empty(control.DisplayedItems);
Assert.Same(control.DisplayedItems, control.DisplayedItems);
Assert.Equal(new Rectangle(1, 0, 185, 22), control.DisplayRectangle);
Assert.Equal(new Rectangle(1, 0, 173, 22), control.DisplayRectangle);
Assert.Equal(DockStyle.Bottom, control.Dock);
Assert.NotNull(control.DockPadding);
Assert.Same(control.DockPadding, control.DockPadding);
Expand Down Expand Up @@ -108,7 +108,7 @@ public void StatusStrip_Ctor_Default()
Assert.Equal(Point.Empty, control.Location);
Assert.Equal(Padding.Empty, control.Margin);
Assert.Equal(Size.Empty, control.MaximumSize);
Assert.Equal(new Size(185, 22), control.MaxItemSize);
Assert.Equal(new Size(173, 22), control.MaxItemSize);
Assert.Equal(Size.Empty, control.MinimumSize);
Assert.Equal(Orientation.Horizontal, control.Orientation);
Assert.NotNull(control.OverflowButton);
Expand Down