From: NadCixelsyd on
I need a form that is 80 characters wide. At 120 twips per character,
that's 9600 twips wide. But the border on my XP system is 4 pixels
(60 twips) on each side, so I add 120 twips and set my form1.width to
9720. Perfect as this gives me 9600 usable twips.

Except on my Vista system, the borders are 6 pixels (90 twips) on each
side.

So how do I find out how wide the border is. How much do I need to
set my form1.width so that I have 9600 usable twips?
From: David Youngblood on
"NadCixelsyd" <nadcixelsyd(a)aol.com> wrote...
>I need a form that is 80 characters wide. At 120 twips per character,
> that's 9600 twips wide. But the border on my XP system is 4 pixels
> (60 twips) on each side, so I add 120 twips and set my form1.width to
> 9720. Perfect as this gives me 9600 usable twips.
>
> Except on my Vista system, the borders are 6 pixels (90 twips) on each
> side.
>
> So how do I find out how wide the border is. How much do I need to
> set my form1.width so that I have 9600 usable twips?

One easy method is to subtract ScaleWidth from Width,

Debug.Print Width - ScaleX(ScaleWidth, ScaleMode, vbTwips)

David


From: Larry Serflaten on

"NadCixelsyd" <nadcixelsyd(a)aol.com> wrote
> I need a form that is 80 characters wide. At 120 twips per character,
> that's 9600 twips wide. But the border on my XP system is 4 pixels
> (60 twips) on each side, so I add 120 twips and set my form1.width to
> 9720. Perfect as this gives me 9600 usable twips.
>
> Except on my Vista system, the borders are 6 pixels (90 twips) on each
> side.
>
> So how do I find out how wide the border is. How much do I need to
> set my form1.width so that I have 9600 usable twips?

How about:

bdr = Me.Width - ScaleX(Me.ScaleWidth, Me.ScaleMode, vbTwips)
Me.Width = 9600 + bdr

LFS


From: Rick Rothstein on
At worst, you could always do it this way...

Me.Width = 9600
Do While Me.ScaleWidth < 9600
Me.Width = Me.Width + 1
Loop


--
Rick (MVP - Excel)



"NadCixelsyd" <nadcixelsyd(a)aol.com> wrote in message
news:72d6c6a9-2a4f-458f-884a-83d17d30da4c(a)r11g2000yqa.googlegroups.com...
> I need a form that is 80 characters wide. At 120 twips per character,
> that's 9600 twips wide. But the border on my XP system is 4 pixels
> (60 twips) on each side, so I add 120 twips and set my form1.width to
> 9720. Perfect as this gives me 9600 usable twips.
>
> Except on my Vista system, the borders are 6 pixels (90 twips) on each
> side.
>
> So how do I find out how wide the border is. How much do I need to
> set my form1.width so that I have 9600 usable twips?

From: Horst Heinrich Dittgens on
> At worst, you could always do it this way...
>
> Me.Width = 9600
> Do While Me.ScaleWidth < 9600
> Me.Width = Me.Width + 1
> Loop

that's why we always need faster CPUs and graphic cards <bg>