CustomFormContext class

The form-class counterpart to CustomControlContext. Extends the base context with Show and Close — the operations a top-level custom form needs that an embedded control does not.

A custom form class receives a CustomFormContext through its ICustomForm.Initialize method. It stores that reference and delegates its own Show and Close methods to the corresponding context methods. The underlying COM interface is _CustomFormContext.

Private m_Context As CustomControls.CustomFormContext

Private Sub OnInitialize(ByVal Ctx As CustomControls.CustomFormContext) _
        Implements CustomControls.ICustomForm.Initialize

    Set m_Context = Ctx
End Sub

Public Sub Show()
    m_Context.Show
End Sub

Public Sub Close()
    m_Context.Close
End Sub

Inherited

A CustomFormContext includes every member from CustomControlContextGetSerializer, Repaint, CreateTimer, and ChangeFocusedElement — and adds the two form-specific members below.

Methods

Close

Closes the underlying window. Equivalent to the user clicking the title-bar close button.

Syntax: object.Close ( )

Application code typically calls WaynesForm.Close, which in turn calls this method through the stored CustomFormContext reference.

Show

Makes the underlying window visible.

Syntax: object.Show ( )

Application code typically calls WaynesForm.Show, which in turn calls this method through the stored CustomFormContext reference.

See Also

  • _CustomFormContext interface – the COM interface this CoClass exposes as its default
  • CustomControlContext class – the base context for embedded custom controls
  • ICustomForm interface – the interface a custom form class implements; receives a CustomFormContext in Initialize
  • WaynesForm – the built-in custom form that uses CustomFormContext