Resize Event — Event Procedures Example

The following example shows how a Resize event procedure can be used to repaint a form when it is maximized. When the user clicks a command button labeled "Maximize," the form is maximized and the Resize event is triggered.

To try the example, add the following event procedures to a form named Contacts that contains a command button named Maximize:

Private Sub Maximize_Click()
    DoCmd.Maximize
End Sub

Private Sub Form_Resize()
    Forms!Contacts.Repaint
End Sub