[Mono-winforms-list] Winforms: Position and Size of Buttons etc.

Rafael Teixeira monoman at gmail.com
Fri Feb 23 07:28:02 EST 2007


Hi Harald,

Windows is also affected by DPI settings, It is normally a dialog for
advanced settings in the screen resolution preferences dialog.

Yes coordinates for buttons and other elements are in pixels and are
unaffected by the DPI setting, but ALL font rendering is affected, so
the buttons come in the right size but text in them come either too
small or to big. labels normally auto-size and may break your layout
when the DPI changes.

Normally Windows use a default 96 dpi setting, as well as Linux, but
sometimes it was adjusted to some other values (worse, your program's
users will adjust toi what they like) and things get easily ugly.
That's is one of the reasons why GTK uses auto-adjustable layouting,

Fun,

On 2/19/07, Harald Friedrich <haraldfriedrich at gmx.net> wrote:
>
> Hi Pavel,
>
> thanks for your answer. But how do I set the DPI (dot-per-inch) value?
> Windows normally is pixel oriented. That means if I set a buttons left|top
> to 10|10, then it is exactly positioned at pixel 10|10. A DPI value in
> Windows for the screen is unknown to me. Is Mono/Linux different?
>
> As you can see, unfortunately I'm coming from the Windows world and am
> exploring the Linux universe ;-)
>
> Thanks for any comment.
>
> Best regards, Harald Friedrich
>
>
>
> Pavel Bansky wrote:
> >
> > Hi Herald,
> >
> > is your DPI set to the same value in Windows and Linux?
> >
> >   Pavel
> >
> >
> >
> > Harald Friedrich wrote:
> >> Hello Mono specialists,
> >>
> >> we were very astonished to see that Delphi.NET programs using WinForms
> >> and
> >> GDI+ can easily be executed with Mono 1.2.3 under Linux.
> >>
> >> The only difference is that the buttons and other graphical components on
> >> forms are somewhat displaced. Even the whole dialog size is changed. Here
> >> see the difference:
> >>
> >> http://www.nabble.com/file/6508/Project6_XP.jpg
> >> (Picture 1: XP view)
> >>
> >> http://www.nabble.com/file/6509/Project6_mono.jpg
> >> (Picture 2: Mono view)
> >>
> >> Can someone tell us, who does this displacement and how to stop it?
> >>
> >> Thanks for any hint.
> >>
> >> Best regards, Harald Friedrich
> >>
> >>
> >
> > --
> > __________________________________________________________
> >
> > Pavel Bánský
> > levap at bansky.net                        I write code...
> > __________________________________________________________
> > _______________________________________________
> > Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Winforms%3A-Position-and-Size-of-Buttons-etc.-tf3234196.html#a9039574
> Sent from the Mono - WinForms mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>


-- 
Rafael "Monoman" Teixeira
---------------------------------------
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man." George Bernard Shaw


More information about the Mono-winforms-list mailing list