Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NullReferenceException when dragging control onto Form

This problem started occurring yesterday: I am trying to drag a button onto a form in a Windows Forms application, but when I do this I get a NullReferenceException (see screenshot here) When I don't use drag & drop, it works fine.

I'm using Windows 10 1803 together with Visual Studio Community Edition 2017 (version 15.9.14)

Any ideas on what may have caused this? Thanks in advance!

like image 814
wserr Avatar asked Aug 05 '26 06:08

wserr


1 Answers

Turns out it has nothing to do with Visual Studio or Windows. My second monitor is attached to my laptop with a VGA cable, and it turns out, when I upscale the monitor, the designer in Visual Studio acts weird.

I noticed it because dragging controls worked when visual studio was displayed on my laptop screen, but not on my VGA monitor.

Turning the scale back to 100% (right mouse click on desktop > display settings) solved the issue for me.

Hope this helps someone.

like image 143
wserr Avatar answered Aug 06 '26 20:08

wserr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!