This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 2 years ago.
Does anyone know why the location of some of my controls is different between designer and run mode? It's driving me nuts. In designer they are all in the right location, anchored as should be, but when I run the application, the form is somewhat resized but the controls don't move accordingly. The ones on the outer right are all somewhat hidden, and resizing the form in run mode does not improve this as they are anchored.
Thanks
Designer view
Run view
Configuring the application to use the correct dpi setting was the solution. Thanks Jimi! :)
Related
This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 4 years ago.
I am trying to create a Windows Forms app using Visual Studio 2017. The app should be run on a 1024x768 touchscreen eventually, that is why I am trying to make all forms in size 1024x768 and without a form border. The problem is that when I launch the app the buttons seem to shift slightly and this makes them fall partially off the screen. The text also seems to be displayed in reduced quality and/or another size. You can look at the images below as an illustration of what I mean.
This is what the form looks like in the designer view in Visual Studio. The text is clear, everything fits the screen and all text fits in the buttons
Designer view of the form:
This second picture shows the form when I actually launch the app. The text quality is reduced, the 'Add From' text does not fit inside the button anymore and the bottom two buttons are partially off the form.
View of the form when app is launched :
My form is set to AutoScaleMode: Font, AutoSize: False.
Are these form parameters wrong or is it something in my Visual Studio settings? I have no clue what I could do to fix this.
Thanks in advance.
The resolution differences looks like a DPI issue. Windows Forms doesn't scale well to a DPI other than 100%. Check your monitor settings.
In Windows 10, this is labelled "Change the size of text, apps, and other items" in Display Settings.
This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 5 years ago.
When my WinForm loads it is always a lot smaller than what I set it to in the builder. For example, I set the size as 2169, 1398, yet it comes up MUCH MUCH smaller than what I wanted. Any answers or suggestions?
When specifying the size of your winform it's highly recommended to save the dimenions in a settings file. Then on your form_load event specify your width and height to the values saved in your settings.
A really good guide on how to do this can be found here
I should also mention that you're going to want to set form1.AutoSize = false to prevent it from changing on you.
This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Why do winform controls move on their own when I save the form
(1 answer)
Creating a DPI-Aware Application
(9 answers)
Closed 5 years ago.
I have been having a problem occuring to me in one of our winforms applications at work.
The problem consists of a Winforms custom control not being displayed properly at run time.
The custom control contains a label, combobox and a button. The Combobox is anchored to right,bottom,left and top. The button is anchored to right, bottom and top.
The custom control can be seen in the figure below 1.
inserting the custom control onto a form and viewing it in the visual 2017 designer works just fine:
But when i execute or debug the application the custom control is not displayed properly as can be seen in 3
Non of my coworkers are having this issue with on their workstations and i also do not have the same propblem on my computer at home.
We have tested it on multiple machines all with the same fresh checkout from our SVN repository and only my machine gets this weird error.
I fixed the error for apporximate 2 weeks ago by simply uninstalling visual studio and reinstalling it, and it worked. But now from one day to the other the problem has come again. It would be nice if anybody knew why this is happening and a possible solution other than reinstalling visual studio.
This question already has answers here:
Why does Visual Studio automatically changes the layout of my form?
(5 answers)
Closed 6 years ago.
I am developing project for a winform c# application in my desktop with 1080p resolution. The size of the form is 1216*939. However, I change another computer with 2560*1800 resolution to continue developing this application. The size of the form and layout will be automatically changed when i open this project. The following link are the pictures for the case I describe
https://www.dropbox.com/sh/zbl8zwcpjnr7kti/aIBuvAWrUs
I was having the same problem, solved by changing the percentage of presentation of the resolution of my monitor from 125 to 100.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I prevent the user from resizing the silverlight out-of-browser window?
Is there any way to actually remove the ability to maximize/resize the out of browser window since I want my application to be of a certain size.
Thanks
I can't be 100% sure but I would hazard a guess you could just go:
this.resizable = false;
this.maximise = FALSE;
in the constructor of the views code behind file.
You can make any new window have no statusbar, no toolbar, no resize, etc. using window.open():
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
However, this is completely dependent on the browser, many ignore this, or have a user setting to override this behavior.