CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2001
    Posts
    2

    OLE container control

    Trying to resize an excel object in an OLE container control. I can't seem to do it. When I embed a workbook in the control, it only fills up part of the control, not the whole thing. So, I would like to resize it, but none of the SizeMode constants seem to work.

    Anyone run into this problem before?


  2. #2
    Join Date
    Aug 2001
    Posts
    26

    Re: OLE container control

    you can resize the object as per the size of the ole control to do that you have to set the sizemode property .
    the code is *** follows
    object.sizemode = value
    and value can be either 0,1,2,3 and the explaination for all these modes is as follows

    VbOLESizeClip 0 (Default) Clip. The object is displayed in actual size. If the object is larger than the OLE container control, its image is clipped by the control's borders.

    VbOLESizeStretch 1 Stretch. The object's image is sized to fill the OLE container control. The image may not maintain the original proportions of the object.

    VbOLESizeAutoSize 2 Autosize. The OLE container control is resized to display the entire object.

    VbOLESizeZoom 3 Zoom. The object is resized to fill the OLE container control as much as possible while still maintaining the original proportions of the object.




  3. #3
    Join Date
    Aug 2001
    Posts
    26

    Re: OLE container control

    i have tries it out writting a sample code it works kindly put in this code in the form load event and see

    ole1.sizemode=1



  4. #4
    Join Date
    Aug 2001
    Posts
    2

    Re: OLE container control

    Thanks for your advice Bhanuprakash. I tried the sizemode=1 in the form_load, but it doesn't work. The spreadsheet does not fill the OLE container control like that setting says it should.

    Have you used OLE container controls a lot?


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

Featured