How to Use SizeMode Property of OLE Control to Size DisplayLast reviewed: June 21, 1995Article ID: Q112043 |
The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
SUMMARYThis article shows by example how to use the SizeMode property of the OLE Control for Visual Basic version 3.0 to obtain a proportional display in a limited screen space.
MORE INFORMATIONThe SizeMode property of the OLE Control determines how the OLE control is sized or how its image is displayed when it contains an object. Here are the valid settings for the SizeMode property:
0 (Default) Clip -- The object is displayed in actual size. If the object is larger than the OLE control, its image is clipped by the control's borders, showing the upper-left portion of the image. 1 Stretch -- The object's image is sized to fill the OLE control. The height of the image is stretched (or shrunk) to fit the OLE control. The same thing happens to the width. As a result, you may get a distorted image. Height and width are independent, not proportional. 2 Autosize -- The OLE control is resized to display the entire object. The object is displayed in actual size. By using the resize event of the OLE control, you can adjust the HeightNew and WidthNew parameters to maintain size limits of the OLE control. However, the display behaves as if you had used the clip setting. Step-by-Step ExampleThe goal of this example is to obtain a proportional display that is restricted to a limited screen space, that of the size of the form the OLE control is on. The example uses AutoSize and Stretch settings to find a proportional best fit. The height and width of the container form supply the maximum height and width of the image. The Autosize property supplies best-fit information. Then the Autosize property is set to Stretch mode for display.
|
Additional reference words: 3.00 OLE Automation OA OLE2
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |