Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. ScaleWidth/ScaleHeight Explantion

ScaleWidth/ScaleHeight Explantion

Scheduled Pinned Locked Moved Visual Basic
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xfitr2
    wrote on last edited by
    #1

    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:

    D 1 Reply Last reply
    0
    • X xfitr2

      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:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups