Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 3rd, 2003, 01:10 PM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ScaleHeight vs. Height

What is the purpose of the ScaleHeight, ScaleWidth, etc. properties compared with the Height, Width properties?

  #2 (permalink)  
Old December 3rd, 2003, 11:10 PM
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Height = ScaleHeight + [CaptionHeight] + [BorderWidth] + [MenuHeight] ...:)

  #3 (permalink)  
Old November 8th, 2005, 09:17 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CaptionHeight? BorderWidth? MenuHeight? What do these things have to do with a picture box having none of them? Why is my picture box ScaleHeight 3015 when the Height is 3040? How come if I set the border to zero, the ScaleHeight=3045 is bigger than the Height=3040.
  #4 (permalink)  
Old November 8th, 2005, 10:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In a nutshell:

Width and Heigth are the size of the component, including the borders (that are also called non-client area, because a client is not supposed to work inside them).
ScaleWidth and ScaleHeight works together with ScaleLeft, ScaleTop and ScaleMode to define the coordinate system for the component. By default, ScaleTop and ScaleHeight are zero, and ScaleWidth and ScaleHeigth are Width and Height minus the border, in vbTwips (the default ScaleMode)
If you want to draw something using millimeters as units, just set ScaleMode to vbMillimeters, and after that ScaleWidth and ScaleHeight return the 'client' area of the control (or form, or Printer) in millimeters.
By default the 0,0 coordinate is in the top-left corner, but changing the scaleXXX properties you can change the coordinate system as you wish.
You can also define a scale to draw in a PictuteBox (or a form, or the Printer object) using a defined-system. For example, you can set the scale of a PictureBox to (0,0)-(100,1) to define an area of 100x1 "units", regradless on the size of the PictureBox (I do this trick to use a PictureBox instead of a progress bar)

For more info, goto

http://msdn.microsoft.com/library/de...caleheight.asp

and then click on See Also and Example

Marco


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed table height and row height rajanikrishna HTML Code Clinic 3 January 18th, 2007 12:42 AM
percentage height GuyB CSS Cascading Style Sheets 1 July 6th, 2006 09:42 PM
Details Height Paula222 Access VBA 1 April 11th, 2006 11:27 AM
min-height in IE cgallagr98 CSS Cascading Style Sheets 5 April 8th, 2005 12:47 PM
Change height of div element if < window height JoelJunstrom Javascript How-To 1 October 10th, 2003 09:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.