ScaleWidth/ScaleHeight Explantion
-
Could someone please explain the difference between scalewidth, scaleheight, scaleX, scaleY, etc. I am really confused. I am trying to set my controls and pictureboxes to automatically resize with the form, but I am having a lot of trouble. I would really like to see an explanation mathematically so that I understand it better. I see a lot of code that uses these with the screen.TwipsPerPixelX, screen.TwipsPerPixelY, but don't quite understand. :confused:
-
Could someone please explain the difference between scalewidth, scaleheight, scaleX, scaleY, etc. I am really confused. I am trying to set my controls and pictureboxes to automatically resize with the form, but I am having a lot of trouble. I would really like to see an explanation mathematically so that I understand it better. I see a lot of code that uses these with the screen.TwipsPerPixelX, screen.TwipsPerPixelY, but don't quite understand. :confused:
ScaleX and ScaleY convert the values from one unit of measure (twips, pixels, whatever's....) to another. ScaleWidth and ScaleHeight get/set the values that represent the width and height of the control/form in the units set by the ScaleMode property. Usually, you leave ScaleMode set to vbTwips. You can use the TwipsPerPixelX and TwipsPerPixelY to determine what the increment should be for ScaleWidth and ScaleY. Say you want to increase the width of a button control by 2 pixels. You would get the TwipsPerPixelX value and multiply that by 2, then add that value to the value in Button1.ScaleWidth. RageInTheMachine9532 "...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome