Re: VB6 fonts on different display sizes



"jerry_ys" <jerryys@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:63CA2100-9456-449E-9D5C-8F1E41183712@xxxxxxxxxxxxxxxx

. . . Also the form size appears a little smaller.

By the way, there is something that I perhaps did not make too clear in my
previous response. If your VB Form is smaller than the display then VB will
display it at exactly the same logical size on all machines, regardless of
their display area (800 x 600, 1024 x 768 etc) and also regardless of their
display resolution (96 dpi, 120 dpi, etc) subject only to a very, very
slight difference under certain specific circumstances due to the fact that
it of course always needs to use whole pixel values. In other words, if your
Form at design time is 4 logical inches wide then it will be 4 logical
inches wide on all machines, regardless of their display settings. The only
time it will be less than 4 logical inches wide is if the display itself is
less than 4 logical inches wide (which of course is highly unlikely). The
reason your Form appears to "look a little smaller" on one machine than it
does on the other is simply because the "logical size" of the display is
probably different. For example, an 800 x 600 display running on a 96dpi
machine will have a logical width of 8.3 inches and the same 800 x 600
display running on a 120dpi machine will have a logical width of 6.7 inches.
As a further example, a 1024x 768 display on the 96dpi machine will be 10.7
logical inches wide and on the 120dpi machine it will be 8.5 inches wide.
So, the apparent width of a 4 inch wide VB Form will be smaller on a display
that is 10.7 inches wide than it is on a display that is only 8.3 inches
wide. These of course are "logical inches" (not "real world inches") and you
will probably by now appreciate that exactly the same machine with exactly
the same physical size display can be a certain number of logical inches
wide at one user setting and a completely different number of logical inches
wide at some other user setting. This "same logical size on all machines"
Form is normally exactly what you want, because both the position and the
size of its contained controls also follow the same "rules", and so the Form
itself and all its contained controls will look exactly the same on both
machines (except that one will appear to be a magnified version of the
other).

The only time this business "falls down" is if the logical size of the
display of the machine on which your code is running is smaller than the
design time logical size of the Form. For example, if you have a fairly
large Form (or perhaps a maximized Form) and you place a text box at each
corner at design time and you compile and run it on your own machine then
the Form will display as expected. However, if you run exactly the same
compiled exe on another machine you may find that the two right hand text
boxes have moved in towards the centre by a considerable amount or have
perhaps moved away from the centre by a considerable amount and have
actually disappeared off the edge of the Form. This is because of the
different logical display width (and height) of the different machines. This
can happen if either the dpi setting or the screen area (or both) is
different on the target machine than on your design time machine. For this
reason you should always add code to read the logical size of the display
and the logical size of your Form's client area at run time and make any
required adjustment to the position of your Form's contained controls.

Also, if you have a small size Form that is likely to be smaller than the
logical size of any machine it is expected to run on, and if you are not
happy with this "same logical size" business (which makes it appear to be
physically smaller or larger on some machines ) and if you instead want your
Form to "look the same size" on all machines, then you really need to add
code to examine the logical size of the display at run time and make your
Form a fixed percentage of that size, adjusting the position of its controls
accordingly.

These things (and a lot of others) are the reason why the "drop onto the
Form" resizing controls do not work very well, unless you use one that is
fully user configurable and that will allow you to tell it to treat the Form
and each individual control in a different way if desired. In my opinion it
is better to save your money and to write your own resizing code from
scratch rather than purchase and configure a well designed resizing control
or alternatively end up using a simpler resizing control that doesn't work
properly.

Mike







.



Relevant Pages

  • Re: VB6 fonts on different display sizes
    ... If your VB Form is smaller than the display then VB will ... Form at design time is 4 logical inches wide then it will be 4 logical ... size of its contained controls also follow the same "rules", ...
    (microsoft.public.vb.general.discussion)
  • Re: Storage of html markup code in database
    ... UIs may include reports and database management tools, ... The details of your desired HTML-encoding may change over time. ... may also differ between display locations within your application. ... While it's unfortunate that the built-in controls are not ...
    (microsoft.public.dotnet.security)
  • RE: Display a record - several questions
    ... ObjectDataSource set up to get the correct record on a select. ... sub controls in the certain tepmlate and modify them. ... How do I display a RadioButtonList and CheckBox value where it is ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Kneisner and Doering KWZ30-2
    ... The controls of the KWZ-30/2 are much more comfortable than the controls of ... colour display with a resolution of 320 x 240 pixels. ... passed though a low pass filter, a switchable high pass filter and an ... mixers are followed by two A/D-converters with a dynamic range of 120 dB. ...
    (rec.radio.shortwave)
  • Re: Is it a habit we prefer mechnical instruments?
    ... Converting the display to a form fit for human consumption ... graphics on standard PC using C++, and you can see the difference. ... simulator that is rendered by a digital display showing analog ... controls are rendered digitally. ...
    (rec.aviation.homebuilt)

Loading