Jump to content
balabuev

Strange mouse scroll-bars behavior

Recommended Posts

I've encountered the following strange behavior of the mouse processing.

 

 

Child controls are standard TScrollBox and TStringGrid controls. In this case:

 

- Pressing mouse button over some specific region of a child control's client area magically treated as a mouse event over the scroll-bar. Mouse-down messages are not dispatched to the control in this case.

- Clicking on the client area (of the same control) outside of mentioned specific region works normally.

- At the same time clicking on scroll-bars also works normally.

 

I've highlighted these inplicit magic regions on the following screenshot. They looks like scroll-bars, shifted some distance to the top:

 

image.thumb.png.5c50bfe9f9ed354cb76f4aaf4b01ef72.png

 

I see such strange behavior for the first time ever. And its interesting, what potentially I should do from WinAPI viewpoint to get such strange offset?

 

 

Share this post


Link to post

Could you show a minimal reproducible example of the behavior you observe? Publish the .pas and .dfm so that we can easily check if we reproduce the behavior here.

Edited by FPiette

Share this post


Link to post

I thought that the reason may be somewhere inside the docking controls code, but, amazingly, I was able to reproduce the issue with simple standard controls. The project is attached:

 

- Run the project

- Press Button1, which will create the second borderless form

- Press Button2, which will shift the form down slightly.

- Try to press mouse button and drag to the right, as shown in attached video:

 

 

Demo project sources:

102.rar

 

 

Share this post


Link to post

I've checked on Delphi 7 :classic_biggrin:, Delphi 2010, Delphi XE, Delphi XE2, Delphi 10.4.1 - everywhere I've encountered this issue. I think it's more probably an issue of the current Windows build, but I may be wrong.

 

My Windows build: 18363.1316

Edited by balabuev

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×