It's not on the edge, but it will resize.
I am having trouble below. It always happens .Is this a bug in Windows?
(1) Prepare two monitors. Set the secondary monitor so that it is to the upper left of the primary monitor.
(2) Create two Forms.
(3) After opening the second form, open the second form with ShowDialog.
(4)When I bring the second form to the second monitor, I can resize it even though it is not at the edge of the window.
environment
Windows 10 20H2
Visual c# 2017
.net framework 4.5
C#
-
tk 1 Reputation point
2021-05-05T01:13:56.157+00:00 Form1.cs` using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.ShowDialog(); } } }
-
tk 1 Reputation point
2021-05-05T01:14:18.21+00:00 Form2.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp1 { public partial class Form2 : Form { public Form2() { InitializeComponent(); } } }
-
tk 1 Reputation point
2021-05-05T01:32:53.35+00:00 (1)First,Click button at Form1, then open Form 2.
(2)Next,Take Form2 to secondary monitor.
(3)So,It happpens. -
tk 1 Reputation point
2021-05-05T01:46:57.45+00:00 WM_NCHITEEST is HTBOTTOMRIGHT inspite of center.
-
Timon Yang-MSFT 9,571 Reputation points
2021-05-05T02:52:27.773+00:00 @tk
Does this problem only occur in winform applications? Will this happen to other applications?
Let us confirm whether this is a problem caused by Winform or a problem caused by Windows itself. -
tk 1 Reputation point
2021-05-05T05:22:19.157+00:00 I tried to create WIn32 API with two windows, but the problem was not happened.
I think it happened by .net framework winform. -
tk 1 Reputation point
2021-05-05T05:23:12.333+00:00 My machine is Surface Laptop 3.
-
tk 1 Reputation point
2021-05-05T05:43:17.623+00:00 This problem happened on another PC I have. It is Win10 1903. Isn't this a serious glitch?
-
Viorel 112.1K Reputation points
2021-05-05T08:15:40.14+00:00 Does it happen with second form only, not with first form, moved to second monitor?
If you are interested, you can also conduct an experiment with some new Forms applications, but using “.NET Core” or “.NET 5” kinds of projects.
-
tk 1 Reputation point
2021-05-05T08:19:51.967+00:00 iT happens second monitor only.And it occurs when the position of the form has a negative screen coordinate value for both X and Y. So, it will not occur in the primary monitor.
-
Viorel 112.1K Reputation points
2021-05-05T08:26:13.263+00:00 Does it happen with the second form only, which was displayed by your code using f2.ShowDialog()? If you move the main (first) form to second monitor without clicking the button, does it happen too?
-
tk 1 Reputation point
2021-05-05T08:30:12.873+00:00 This happens by dragging the title bar to bring Form2 to a second monitor, no matter where Form2 is initially displayed.
-
Timon Yang-MSFT 9,571 Reputation points
2021-05-06T01:24:13.297+00:00 @tk
I don't have a second monitor, so I can't fully reproduce your error. But according to your description, this should be a mistake in .Net.
I suggest you report your problem in the Developer Community and ask the team to investigate.
Sign in to comment