Re: form size suddenly not correct



"Duncan Chesley" <BioColor@xxxxxxx> wrote in message
news:grpnd198uepuhf0thi13bir7pavnq5q2p7@xxxxxxxxxx

> I recently updated my ATI Radeon 9200 video driver and
> a couple of optional patches from Microsoft (including .net
> framework sp1 I think). I'm running VB6SP6. Now my fonts
> and form sizes appear incorrectly.

As Frank has already said (and as you seem to have since confirmed) it is
almost certainly a driver problem on your own machine. However, if you want
your Forms to always be a fixed pixel size (800 x 600 pixels in your case) I
would definitely advise that you set the size at run time by reading the
systems "pixels per inch" (or twips per pixel) setting and altering the
Width and height properties accordingly. I would also advise that you do
exactly the same for all the Controls on your Form, while also taking into
account the different border thicknesses on different machines. VB *always*
stores the desired size using Twips as the unit of measurement (both in your
..frm files and in your compiled exe file), and it do so regardless of the
values you are using for ScaleMode or whatever at design time. Moreover, it
determines the "required number of twips" from the current settings of your
own development machine (or whatever other machine you happen to compile it
on). For example, if you set the Form's ScaleMode property to vbPixels and
then position something at location (100, 100) and then compile / save it VB
will "read" the twips per pixel value of your current development machine
and set the "twip coordinates" accordingly (1200, 1200 on a typical large
fonts machine) and it will then store those twip values in your .frm and
your .exe files. Then, when your app is run on another machine, the VB
runtime on that machine will "pick out" the stored twip values from the exe
file and it will determine the "pixel position" according to the twips per
pixel on that specific machine, resulting in different placements on
different machines. If you want to reliably fix the pixel size of a Form
(and the size and position of its controls) then you've got to do it in code
at run time.

Mike



.



Relevant Pages

  • Re: Picture in image control gets cliped "Sometimes" does not stay
    ... the width of the picture in the Image control. ... per logical inch (the equivalent of 15 twips per pixel) whereas others run ... exactly the same "twip size" as the design time twip size client area on ...
    (microsoft.public.vb.general.discussion)
  • 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: Why back groud image becomes smaller?
    ... When VB loads your Form it looks at the number of "twips per pixel" on whatever machine your code is currently running and it looks in the exe file at the "twip size" you set at design time for the Form and its controls. ... Therefore, if the number of "twips per pixel" (or, alternatively, the number of "pixels per inch") on the machine on which your exe is currently running is different than the "twips per pixel" on your development machine then the pixel size of the Form will be different. ...
    (microsoft.public.vb.general.discussion)
  • Re: Form is truncated.....
    ... Most machines run at 96 dpi (15 twips per pixel) but quite a lot run at 120 dpi and some at various other settings. ... 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. ...
    (microsoft.public.vb.general.discussion)
  • Re: fuzzy pictures in Pub 2003.
    ... What is the pixel size of these images? ... an updated video driver? ... This is not tech support ...
    (microsoft.public.publisher)