Click to See Complete Forum and Search --> : ActiveX control size


Mike Harnad
April 23rd, 1999, 01:54 PM
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

Dmitriy
April 23rd, 1999, 02:28 PM
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;
}