Real Software Forums
http://forums.realsoftware.com/

Converting size in twips of user interface items in VB6
http://forums.realsoftware.com/viewtopic.php?f=13&t=40852
Page 1 of 1

Author:  torrid [ Mon Oct 03, 2011 1:12 pm ]
Post subject:  Converting size in twips of user interface items in VB6

Hi,

I already have a user interface my customers are used to.... I'd like to set the button width and height as well as panels sizes etc. to be the same in RealBasic... but in VB6 the height and width of a button is in twips I think.

So Height 675 and Width 1755 .... how do I convert that to set the props in RB?

This will help me set the size of all my other controls as well.

Also I found that the grid controls and buttons are not resizing when I hit the Maximize button on the form. Do I have to do that manually in code? if so where would I put it.

-Tim

Author:  kermit [ Mon Oct 03, 2011 1:34 pm ]
Post subject:  Re: Converting size in twips of user interface items in VB6

VB measurements can be pixels or twips.
In RB its pixels.

A twip is 1/1440 of an inch.
On a screen running 96 dpi, to convert trips to pixels, roughly multiply by 1440/96

When you have the control on screen, you can use the anchor properties at the right to determine how the control moves about when the window resizes

Author:  DaveS [ Mon Oct 03, 2011 5:55 pm ]
Post subject:  Re: Converting size in twips of user interface items in VB6

uh... I thought a TWIP was 1/1440" and was something in VB that I avoided like the plague.
it is 1/20 of a POINT

Quote:
A twip (abbreviating "twentieth of a point", "twentieth of an inch point"[citation needed], or "twentieth of an Imperial point"[citation needed]) is a typographical measurement, defined as 1/20 of a typographical point. One twip is 1/1440 inch or 17.639 µm when derived from the PostScript point at 72 to the inch, and 1/1445.4 inch or 17.573 µm based on the printer's point at 72.27 to the inch.

Author:  Bob Keeney [ Mon Oct 03, 2011 9:52 pm ]
Post subject:  Re: Converting size in twips of user interface items in VB6

Quote:
Also I found that the grid controls and buttons are not resizing when I hit the Maximize button on the form. Do I have to do that manually in code? if so where would I put it.


You can either set their Lock properties (left, top, right, bottom) of each control, or you can resize them manually in the Window.Resizing or Window.Resized events. Regardless, you'll spend some time making sure they work properly for a maximized window vs. a default window size.

Author:  kermit [ Mon Oct 03, 2011 11:37 pm ]
Post subject:  Re: Converting size in twips of user interface items in VB6

Quote:
I thought a TWIP was 1/1440" and was something in VB that I avoided like the plague.
it is 1/20 of a POINT


Quite right.
Its been a long time, and I too avoided twips like the plague.
Even Apple doesn't like them. It keeps changing twips to trips as I type, hence the edit.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/