Setting a C # form to a negative location

I am working on a tool for Windows that will interact with CloudApp using its API. I found here a few articles on how to achieve the capture of the region that I used for modification to fit my exact needs. Everything is going very well, but I have problems setting up multiple monitors. The reason is because I run one monitor at 1920x1080 and the second at 1080x1920.

The general flow is that I create an image of the entire screen (3000, 1920), then I show it as a background in the form. The problem is that I cannot get this form to start from a negative point, so it moves everything.

If I look at the original image that I captured before choosing a region, everything is fine:

http://img.paronity.com/KsiA

enter image description here

The problem is when I am going to create a region shape. In order for it to be the background of the form and be in the right place, I would need the shape of the upper left X, Y - (0, -670). No matter what method I try, I cannot achieve this.

Is there any way to achieve a negative moment that I do not see? In order to be complete, I made a very simple form that displays its β€œtop” coordinate when you move it, and when I move it to the top of the vertical monitor, I get negative points, so I know that they are valid,

Let me know if any part of my code is useful, and I will send it. I just was not sure that it would be necessary. Thanks in advance!

+6
source share
1 answer

Sorry for posting. It can be done. The problem was that I set the size of the form in the constructor for the form. I did not know that this would not work. As soon as I installed it on the form load event, he moved it to the right place.

Thanks @dognose! You say that your test helped me think that this was probably a coverage / placement problem, and it was! Thanks to everyone who looks at this question!

+2
source

All Articles