I'm currently developing a game in C# for a University project and have 3 different Windows Forms that make it up.
I was primarily developing the game on my main computer which has a monitor with the resolution of 1920x1080 and all of the elements in each window fit the window as they should. However, when I open it on the laptop I take to university which has a resolution of 1366x768 they don't fit the window and either go out of the visible area of the window or overlap.
I've set the windows to be a certain size and turned off resizing and the maximise button.
This image shows exactly what is happening:
The window shown above is set to 'FormBorderStyle: FixedSingle' and 'Size: 588, 470'.
Related
My program Is full screen, And It's difficult designing it in the designer because you can only see about a half of the form. Is there a way to scale down the designer, and to make it scale up when the code is ran?
Your main issue is your desire to design a "full screen" program. Ask yourself--what does "full screen" mean? You soon will realize that it can mean 1024x768 resolution, 1920x1080, or any of a number of other common resolutions. Add mobile devices to the mix, and you should see the issue here.
Read up on Winforms anchor, dock, and control metrics properties (size [height, width] and location [top, left]) to determine how best to lay out your form so that it auto-adapts to a full-screen canvas. The TableLayoutPanel and various third-party components (DevExpress, Syncfusion, ComponentOne, etc.) can help you too.
I have build a UWP project in 12" tablet size (which I chose from options provided when I design the UI in designer)
However when I run the application, it is shown too big on my screen, my design could not shown completely on the screen.
For example, I have 2 buttons in my design form top to down, only the top one is shown but the below one is missing due to my screen is not big enough to show them. But my laptop screen is 15.6", and previously the program was run in another desktop with a 24" monitor and it shows correctly.
Is there anything I can do to change the resolution/scale of my application on the laptop screen? My laptop resolution is 1920x1080.
Thank you.
I think the resolution is 2160*1440 for 12" 150% scale, my laptop resolution is only 1920*1080, how do I change the resolution?
Windows automatically selects a scale factor for each display based on its DPI (dots-per-inch) and the viewing distance of the device. So that the scale factor is defined by the windows. Details please reference Effective pixels and scale factor.
Users can override the default value and by going to Settings >System> Display > Scale and layout settings page. You could change the scale to 100% for your laptop.
I have a desktop app that is developer for Windows operating Environment.The App was developed on a 1,280x720 Monitor.It works very well on most systems with normal screen resolutions.Including 1080P and old 17 and 15 inch monitors.
The thing is when it comes to Laptops with 15" screen and 1080P resolution,the App shows up correctly at first but after using a control,the window gets smaller.The Text gets larger and some controls fall on top of others.
Another issue is that when the user has adjusted this size setting to High
The app window gets Cut and it does not show the complete content.The Application is not full screen.
One user was using a Windows Surface Pro and to get the Application Fit,the above setting was reduced.But this made the App too small,so the user ended up getting a refund.
I'm not targeting Tablet(Surface Pro) users.The intended audience is desktop Users.
What is the best way to tackle this issue keeping winforms GUI.
Please advice.
It seems you're looking for the AutoScaleMode property. This will allow your controls to change size according to the zoom level of your users' PCs (which you pictured above).
There is some really good advice in this answer to 'Creating a DPI aware application'. But basically:
Set the AutoScaleMode of your base control (the Form) to Font or Dpi
Remove as many custom font settings from your controls as possible (this will restore them to the default MS Sans Serif at ~8pts)
Develop the app at the standard zoom level and then test it on larger screens with higher zooms, see how it goes.
Hope this helps
I am currently working on widows8 metro app tablet version.In My package.appmanifest file I have choose supported rotation as landscape.but when iam launching the applicaiton by holding the device in portrait mode.For fraction of seconds splash screen is coming in portrait mode and then it changed to landscape.
can anyone know how to solve this problem. because of this issue i am facing other issues.
You can add your custom splash screen. If your application only supports landscape, you could make your splash screen appear in landscape by manually adjusting the image to load.
Another option could be to make an extended splash screen. This way, you can programatically make your splash screen appear for say, a second or so.
Check this article from Microsoft, Creating a fast and fluid app launch experience, which has examples and information about extended splash screens.
I am currently developing a Winforms Application that will run on a very specific tablet PC.
My development environment uses dual-17" monitors which are far bigger than the tablet screen size of 10.4" (1024x768).
Due to the purchasing department at my company the delivery of the tablet will not be until well into the design cycle.
Is it possible to mimic the tablet size so that I can adjust my forms to match?
You have couple of options:
set one of your screens to the tablet resolution. You might need to move your taskbar to that screen to get the proper-sized workspace.
install Virtual PC and create a VM with the tablet resolution.
set your main form size explicitly to the tablet PC resolution. For best results size it to the proper workspace size, not the desktop size.
Note that your form will have to still be relatively flexible, since users might configure their taskbar to be at a different position, or different size, thus affecting the available workspace for your app.
The fact that you have 1024x768 on 10.4" means the pixels are denser than your typical PC monitor. That means that text 10 pixels high on your monitor might look fine, but 10 pixels high on the tablet PC may be tiny and almost unreadable (even without loss of resolution).
Unless you can find a monitor with similar pixel density, I don't think you can properly mimic it. Even if you can shrink the application to a 10.4" section of the monitor, now you're probably dealing with sub-pixel shading which will look blurrier than on the tablet PC.
The best you can probably do is setting one of your monitors to 1024x768 (without stretching to fill the screen!), or just set your app to that size and eyeball it to take into account that it will actually be smaller.
You could try hosting your main form inside a user control or another form limited to the relevant size. However, the form is then not a "top level" form, but fairly closely looks and behaves like one.
You can perform normal form actions (minimise / maximise / move / resize / etc) so you can get a feel for what it is like and a certain size.
However in this instance, its best to always design the UI for the minimum resolution you have to target, and have it scale upwards on larger monitors.
very easy - if you're concerned about size, or users have to use the touch screen, start your form out with 10pt+ font
very cool - design the form size as, oh, 950x650. Experiment with the anchor property of each control. Allows you to make basically totally resizable controls (if you get creative with the anchor on groupboxes/panels and the controls inside them).
then set your form to maximize itself on the tablet PC (or e.g., if screen size is <= 1280x1024 - the Anchor property has its limitations as to what size increase looks reasonable).