c# - Form controls displaced when installed on another computer -


i know there folks vote question down or ask close. if there kind of information or code can provide know more program let know. please keep reading , see if have had similar problem.

i running win7 64bit .net framework ver 4.5.

i have created winform application. , create form elements have taken advantage of library called metroframework gives program metro , feel. contains standard controls , user controls inherit original form class. opening view of program.

enter image description here

however, strange reason, when came install program on 2 other computers (one running win7 , other win8), noticed of form elements have changed location , have disappeared or have been displaced. has frightened me knowing amount of time have spent put elements in place.

everything looks fine on own computer both in dev environment , after building application in release version. @ first thought screen resolution problem on other 2 devices, not case either. , if was, why should happen?

can please me solve problem? share part of code need. have no idea source of problem is!

the main influence on layout variations on different machines theform.autoscalemodeproperty.

in theory default setting should work fine found best switch off completely, going dpi or font none..

msdn explains little intended effect.

btw: containercontrol.autoscalemode property, choose different modes parts of forms described here:

the autoscalemode property specifies current automatic scaling mode of control. scaling font useful if want have control or form stretch or shrink according size of fonts in operating system, , should used when absolute size of control or form not matter. scaling dpi useful when want size control or form relative screen. example, may want use dots per inch (dpi) scaling on control displaying chart or other graphic occupies percentage of screen.

to remain true pixel-precise layout use:

this.autoscalemode = system.windows.forms.autoscalemode.none; 

the last value in autoscalemode enumeration inherited chosen nested containers.

update: choice of containercontrolsis rather limited:

system.windows.forms.form system.windows.forms.propertygrid system.windows.forms.splitcontainer system.windows.forms.toolstripcontainer system.windows.forms.toolstrippanel system.windows.forms.updownbase system.windows.forms.usercontrol 

maybe useful usercontrol. note doesn't expose autoscale property in instances in class definition. note can't add controls instance in desiger, assemble them in maybe panel , set usercontrol (with autoscale=font) panel's parent.. you'll need allow space in case, though..


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -