CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    3,585

    ActiveX control size

    Does anyone know how to set the initial size of an ActiveX (OCX) control in a container? I've never really been able to do this consistently. I've tried using SetInitialSize() in my constructor, but I don't get the size I expect. For instance, I created a control that's based on a "button". When I display it in the test container it's one size, and, in a test dialog it's another. Now, I know that since it's two different containers, this will affect the size. But, all I'm tyring to do is initially display my control the same size as a normal C++ "button" control. The $64,000 question: How does one set the size of a control when it's first instantiated and displayed? Any help would be greatly appreciated.

    TIA,
    Mike

    Gort...Klaatu, Barada Nikto!

  2. #2
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: ActiveX control size

    Try OnSetExtent(). Add a variable BOOL bFirstTime=TRUE in constructor & when will recieve first time
    OnSetExtent(), change this bFirstTime=FALSE.
    In procedure
    OnSetExtent(){
    if (bFirstTime)
    SetMySize();
    bFirstTime=FALSE;
    }



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