Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake an ActiveX control that fills its parent form when the form resizes
KeywordsActiveX control, resize, parent
CategoriesActiveX, ActiveX Controls, Controls
 
Declare a Form variable WithEvents. In the control's ReadProperties event handler, set this form to the parent form so the program can watch for its Resize events.
 
Private Sub UserControl_ReadProperties(PropBag As _
    PropertyBag)
    If Ambient.UserMode Then
        Set ParentForm = UserControl.Parent
    End If
End Sub
 
In the parent's Resize event handler, use the Extender to resize the control.
 
Private Sub ParentForm_Resize()
    Extender.Move 0, 0, ParentForm.ScaleWidth, _
        ParentForm.ScaleHeight
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated