|
|
Title | Make an ActiveX control that fills its parent form when the form resizes |
Keywords | ActiveX control, resize, parent |
Categories | ActiveX, 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
|
|
|
|
|
|