Results 1 to 4 of 4

Thread: Form1.ScaleHeight and Form1.Height

  1. #1

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116
    What is the difference and when should I use which?

    Form1.ScaleHeight and Form1.Height
    License to Program

    007

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Here is what MSDN Help has to say

    ScaleHeight, ScaleWidth Properties


    Return or set the number of units for the horizontal (ScaleWidth) and vertical (ScaleHeight) measurement of the interior of an object when usinggraphics methods or when positioning controls. For MDIForm objects, not available atdesign time and read-only atrun time.

    Syntax

    object.ScaleHeight [= value]

    object.ScaleWidth [= value]

    The ScaleHeight and ScaleWidth property syntaxes have these parts:

    Part Description
    Object Anobject expression that evaluates to an object in the Applies To list.
    Value Anumeric expression specifying the horizontal or vertical measurement.


    Remarks

    You can use these properties to create a custom coordinate scale for drawing or printing. For example, the statement ScaleHeight = 100 changes the units of measure of the actual interior height of the form. Instead of the height being n current units (twips, pixels, ...), the height will be 100 user-defined units. Therefore, a distance of 50 units is half the height/width of the object, and a distance of 101 units will be off the object by 1 unit.

    Use the ScaleMode property to define a scale based on a standard unit of measurement, such astwips,points,pixels, characters, inches, millimeters, or centimeters.

    Setting these properties to positive values makes coordinates increase from top to bottom and left to right. Setting them to negative values makes coordinates increase from bottom to top and right to left.

    Using these properties and the related ScaleLeft and ScaleTop properties, you can set up a full coordinate system with both positive and negative coordinates. All four of these Scale properties interact with the ScaleMode property in the following ways:

    Setting any other Scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is user-defined.


    Setting ScaleMode to a number greater than 0 changes ScaleHeight and ScaleWidth to the new unit of measurement and sets ScaleLeft and ScaleTop to 0. In addition, the CurrentX and CurrentY settings change to reflect the new coordinates of the current point.
    You can also use the Scale method to set the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties in one statement.

    Note The ScaleHeight and ScaleWidth properties aren't the same as the Height and Width properties.

    For MDIForm objects, ScaleHeight and ScaleWidth refer only to the area not covered by PictureBox controls in the form. Avoid using these properties to size a PictureBox in the Resize event of an MDIForm.

  3. #3

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116
    Thanks Martin
    License to Program

    007

  4. #4
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    resizing the stuff on my form - is it possible?


    Hi there,

    I have a few line objects and some text on my form2. form2 pops up when a command button on form1 is clicked. form2 stays on top of form1, so sometimes text and stuff is not visible on form1.


    It would be great if, when the user is making form2 bigger or smaller - by dragging its borders, the lines and text would be resized proportionately. Is this possible? How would I do it and where could I start?

    Thanks for any help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width