Re: Form is truncated.....



"John Morley" <jmorley@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:u8BLOFtMIHA.4272@xxxxxxxxxxxxxxxxxxxxxxx

A user is reporting that a form in my VB6 application is
truncated at the bottom when it is displayed. Approximately
the lower 1/3 of the form is not visible.

It will be the user's dpi settings (what used to be called "small fonts" and "large fonts"), and possibly also the different height of the Caption bar and the user's task bar on different systems. Most machines run at 96 dpi (15 twips per pixel) but quite a lot run at 120 dpi (12 twips per pixel) and some at various other settings. For example, if a Form is such a size that on your own system it is 800 pixels high and if your development machine is running at 96 dpi then VB will use the value of 12000 twips for its overall height, and that is the value it will store in your exe. If you then run that exe on a machine that happens to be running at 12 twips per pixel the VB runtime will set its size to however many pixels happens to equate to 12000 twips on that specific machine, which on the 12 twips per pixel will be 1000 pixels (25 per cent larger than it was on your development machine). You really do need to add code check all of the settings and screen sizes and task bar size and position and dpi settings at run time and to adjust everything accordingly. This will often include not only changing the size of your Form but also changing either the size or position (or both) of all its contained controls. This is not just a VB thing (although certain parts are specific to VB). All good applications, whether they are VB applications or not, always need to check the display on which they are running and adjust themselves accordingly.

Mike


.



Relevant Pages

  • Re: Picture in image control gets cliped "Sometimes" does not stay flu
    ... the width of the picture in the Image control. ... This will almost certainly be because your code is not properly taking into acount the differences in the Windows dots per inch (or twips per pixel) setting on different machines. ... The only time it will fail to do this is if the pixel size of the display on which your code is running is not sufficient to display such a Form, in which case it will make the client area as large as it can under the circumstances. ...
    (microsoft.public.vb.general.discussion)
  • Re: Clip capture - thanks Mike!
    ... >some things is default vbPixels. ... >>> make sense if the smallest division is Pixel. ... as so it follows that there are 1440 twips in one inch. ... >> by the pixel resolution of the display. ...
    (comp.lang.basic.visual.misc)
  • Re: Form is truncated.....
    ... on the win2k; only diff is the dpi settings. ... Twips per Pixel = 11 ...
    (microsoft.public.vb.general.discussion)
  • Re: Form is truncated.....
    ... Twips per Pixel = 11 ... dpi = 96 ... Previously you had said that on both machines the Forms were approximately the same height and you implied that the dpi setting therefore had nothing to do with it. ...
    (microsoft.public.vb.general.discussion)
  • Re: Bilder in Berichten
    ... Bei gleicher DPI bleibt natürlich die Anzahl der Pixel ... Access erweckt den Eindruck, als würde es Größenangaben in Twips speichern. ...
    (microsoft.public.de.access)

Loading