dotnet / dotnet/winforms

DTS: USER32!SetScrollInfo is not called as expected when you drag the scrollbar over the window

Open
#3,614 0 comments 0 reactions 0 assignees View on GitHub
:construction: work in progress area-Layout
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

* .NET Core Version:

5.0.100-rc.1.20367.2

* Have you experienced this same bug with .NET Framework?:
Yes

**More info:**

1. This is **not** a regression issue in both .NET Framework and .NET Core.
2. If add the below code in **hScrollBar1_Scroll** event handler, this issue will not be reproduced.
`panel1.PerformLayout();`

**Problem description:**

The label15 appears on the left side when the position of the scrollbar is left side as below.
![Actual](https://user-images.githubusercontent.com/45864985/88019319-1cde9380-cb5c-11ea-8ecf-6400076c6ebd.png)

**Expected behavior:**

The label10 should appears on the left side when the position of the scrollbar is left side as below.
![Expected](https://user-images.githubusercontent.com/45864985/88019323-20721a80-cb5c-11ea-9614-221902840089.png)

**Minimal repro:**

1. Launch the attached project in VS and run it.
2. Drag the scrollbar to the right edge, and continue move the mouse cursor from the right edge outside the form, still keep mouse button down. (The scrollbar will returns to left side automatically)
3. Move mouse cursor back into the right edge of form, still keep mouse button down.
4. Then move the mouse cursor from the right edge outside the form again, and release the mouse.
[TestApp.zip](https://github.com/dotnet/winforms/files/4951672/TestApp.zip)
![ReproSteps](https://user-images.githubusercontent.com/45864985/88020032-8a3ef400-cb5d-11ea-94b5-f45af611651a.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.