Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
@@ -0,0 +1 @@
override System.Windows.Forms.TrackBar.OnSizeChanged(System.EventArgs! e) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ private void DrawTicksManually()
}

PInvokeCore.SendMessage(this, PInvoke.TBM_CLEARTICS, (WPARAM)1, (LPARAM)0);
for (int i = _minimum + drawnTickFrequency; i < _maximum - drawnTickFrequency; i += drawnTickFrequency)
for (int i = _minimum + drawnTickFrequency; i <= _maximum - drawnTickFrequency; i += drawnTickFrequency)
{
LRESULT lresult = PInvokeCore.SendMessage(this, PInvoke.TBM_SETTIC, lParam: (IntPtr)i);
Debug.Assert((bool)(BOOL)lresult);
Expand Down Expand Up @@ -999,6 +999,27 @@ protected override void OnSystemColorsChanged(EventArgs e)
RedrawControl();
}

protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);

if (!IsHandleCreated)
{
return;
}

bool recreateHandle = ShouldRecreateHandle();
if (recreateHandle)
{
RecreateHandle();
}
else if (!_autoDrawTicks)
{
DrawTicksManually();
Invalidate();
}
}

/// <summary>
/// Overrides Control.SetBoundsCore to enforce auto sizing.
/// </summary>
Expand Down