Visual Basic Concepts

Determining How an Object is Displayed in the OLE Container Control

You can use the OLE container control's DisplayType property to indicate if the object will appear as an icon (set DisplayType = 1), or if the object's data will be displayed in the control (set DisplayType = 0). This property also determines the default setting of the Display As Icon check box when the Insert Object and Paste Special dialog boxes are displayed at both run time and design time.

Note   Once the OLE container control contains an object, you cannot change its display type. You can, however, delete the linked or embedded object, set the DisplayType property, and then insert a new object.

You use the SizeMode property to determine how an object's icon or data image is displayed in the OLE container control when the control is not UI (user-interface) active. A setting of 0-Clip or 3-Zoom clips the image to fit the control, but it doesn't change the actual size of the image (you might not see all of the image when editing it). An object that is smaller than the control is edited in an area smaller than the control. An object larger than the control fills the entire container area and may be clipped if it is larger than the control area. Alternately, setting SizeMode to 2-AutoSize resizes the control to fit the image.