
Signature
Tangent: A sunburned man. (Pierre Abbat)
[Abolish the TV License - http://www.tvlicensing.biz/]
> How did you come to the values 4900,2400 in the first place?
> Whatever calculation was used to determine these values is
> the calculation you need to perform.
There was no calculation. I changed the values and tried until I had the
right ones.
> In general you look to the container of the object you want
> to size for relevant dimensions
What does that mean?
Can you give me one example of how this should look?
Marco
> "Marco Krechting" <marcokrechting@zonnet.nl>'s wild thoughts
> were released on Fri, 30 Jul 2004 14:25:22 +0200 bearing the
[quoted text clipped - 67 lines]
>
> Jan Hyde (VB MVP)
Jan Hyde - 30 Jul 2004 15:00 GMT
"Marco Krechting" <marcokrechting@zonnet.nl>'s wild thoughts
were released on Fri, 30 Jul 2004 15:46:33 +0200 bearing the
following fruit:
>> How did you come to the values 4900,2400 in the first place?
>> Whatever calculation was used to determine these values is
[quoted text clipped - 7 lines]
>
>What does that mean?
I though I had explained this in the bit you removed when
you quoted my reply.
>Can you give me one example of how this should look?
Start a new project and add a label to the form.
Add this code
Private Sub Form_Load()
'-- Size the form to fill the left half of the screen
Me.Move 0, 0, Screen.Width / 2, Screen.Height
End Sub
Private Sub Form_Resize()
'-- Always make the label cover the left half of the form
Label1.BackColor = vbRed
Label1.Move 0, 0, Me.ScaleWidth / 2, Me.ScaleHeight
End Sub
Now run it, try changing the size of the form and notice how
the label will *always* cover half the form.
Try changing to a different screen res and run the project
again. Notice that whatever screen res you run the project
in, the form always covers half the screen.
The label is sized relative to the form (it's container)
The form is sized relative to the screen (it's container)
I could have written
Label1.Move 0, 0, 2940, 8595
and that would look fine on my screen res, but when I moved
the form to a different size, or ran in a different screen
res, it would not be correct.
>> "Marco Krechting" <marcokrechting@zonnet.nl>'s wild thoughts
>> were released on Fri, 30 Jul 2004 14:25:22 +0200 bearing the
[quoted text clipped - 68 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
The average guy thinks about sex once every six tits
[Abolish the TV License - http://www.tvlicensing.biz/]
Ken Halter - 30 Jul 2004 17:34 GMT
Adding to other replies... keep in mind that your 4900,2400 are in
Twips. That means... if the user has their system set to Small Fonts,
the box will be 326x160 pixels....
'immediate window
?4900/15
326.666666666667
?2400/15
160
....but if the system's set to Large Fonts, that box will be 408x200
pixels....
'immediate window
?4900/12
408.333333333333
?2400/12
200
... and if they have their system set to Custom Fonts, who knows how big
the box will be.
The safest way to deal with it is to always use Pixels in your
calculation.. even if your form's set to use Twips.
MyBox.Move 326 * Screen.TwipsPerPixelX, 160 * Screen.TwipesPerPixelY
>>How did you come to the values 4900,2400 in the first place?
>>Whatever calculation was used to determine these values is
[quoted text clipped - 85 lines]
>>
>>Jan Hyde (VB MVP)

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Bob Butler - 30 Jul 2004 17:53 GMT
> The safest way to deal with it is to always use Pixels in your
> calculation.. even if your form's set to use Twips.
>
> MyBox.Move 326 * Screen.TwipsPerPixelX, 160 * Screen.TwipesPerPixelY
I often find the ScaleX and ScaleY methods easier to work with:
mybox.move
me.scalex(326,vbPixels,me.ScaleMode),Me.ScaleY(160,vbPixels,Me.ScaleMode)
It's more typing but tells me immediately that I'm setting it to 326x160
pixels regardless of the scalemode of the container

Signature
Reply to the group so all can participate
VB.Net... just say "No"