1

I am having issues publishing a WinForms application to other computers. I've used Visual Studio 2010 to design and program the application and when I send the EXE or the OneClick installer to another computer and try running it there, it runs fine however it would seem the resolution or something is off. PictureBoxes are overhanging the edge, some controls cutoff by the form window limits. I obviously did not put those controls there like that. When I run the application on my computer, the controls are all the right size/where they are supposed to be.

The question is, how do I configure the published EXE to use the same resolution I've coded it in or somehow accommodate for the different screen resolutions that the application may be run on?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
ikathegreat
  • 2,311
  • 9
  • 49
  • 80
  • You would need to set the AutoScaleMode property of the UserControl to AutoScaleMode.Dpi, and not set the AutoScale property to true. If you do, it will reset the AutoScaleMode back to None. The AutoScale property is obsolete and is there only for backwards compatibility http://msdn.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx or Google `Creating a DPI-Aware Application` – MethodMan Jan 08 '13 at 05:04
  • not sure what to search for. what i've found is i need to design the form in the intended deployment resolution? that sounds so...lame. http://stackoverflow.com/questions/1833725/visual-studio-windows-form-preview-in-different-resolution – ikathegreat Jan 08 '13 at 05:04
  • Check out the link that I have in my previous comment also google search on this `Creating a DPI-Aware Application` – MethodMan Jan 08 '13 at 05:05
  • here http://msdn.microsoft.com/en-us/library/ms701681%28VS.85%29.aspx – MethodMan Jan 08 '13 at 05:07
  • here is a Stackoverflow posting whether the posting(s) sound lame or not something require a bit of extra work / coding on your end that's what we are programmers expect nothing is ever as simple as 123.. http://stackoverflow.com/questions/572820/c-sharp-scaling-usercontrol-content-to-match-users-dpi-font-size – MethodMan Jan 08 '13 at 05:09
  • Always start with the minimum resolution u intent to support, then use anchor and docking to rescale the controls. Either 800x600 or 1024x768 is appropriate. – SekaiCode Jan 08 '13 at 05:09

1 Answers1

4

From your requirements, you need to build a "resolution independent/adaptable" front-end.

Here are some options you could use to re-design your forms :

Layout controls like TableLayoutPanel control and FlowLayoutPanel control

Reference

http://forums.codeguru.com/showthread.php?490012-How-to-make-a-Resolution-Independent-Application

http://vbcity.com/forums/t/88845.aspx

http://www.andreavb.com/forum/viewtopic_5501.html

Think of using the AutoScaleMode enumeration

Reference

http://msdn.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx

http://www.codeproject.com/Questions/245199/Creating-resolution-independent-applications-in-VB

Heck, its high time for you invest in WPF

Reference

http://msdn.microsoft.com/en-us//library/ms754130.aspx

Umesh .A Bhat
  • 587
  • 3
  • 15
  • 27