# _CustomFormContext interface
{: .no_toc }

The underlying COM interface for [**CustomFormContext**](/tB/Packages/CustomControls/Framework/CustomFormContext.md), extending [**_CustomControlContext**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md) with **Show** and **Close** --- the two operations a top-level custom form needs that an embedded control does not.

User code works with [**CustomFormContext**](/tB/Packages/CustomControls/Framework/CustomFormContext.md) directly; this interface page documents the method contract that the CoClass exposes.

## Inherited

Every member of [**_CustomControlContext**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md) is also present on **_CustomFormContext** --- [**GetSerializer**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md#getserializer), [**Repaint**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md#repaint), [**CreateTimer**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md#createtimer), and [**ChangeFocusedElement**](/tB/Packages/CustomControls/Framework/_CustomControlContext.md#changefocusedelement).

## Methods

### Show
{: .no_toc }

Makes the underlying window visible.

Syntax: *object*.**Show** ( )

The method maps to the Win32 show-window operation on the form's HWND. Application code typically calls [**WaynesForm.Show**](/tB/Packages/CustomControls/WaynesForm/index.md#show), which in turn calls this method through the stored [**CustomFormContext**](/tB/Packages/CustomControls/Framework/CustomFormContext.md) reference.

A custom form class casts the [**CustomControlContext**](/tB/Packages/CustomControls/Framework/CustomControlContext.md) it receives in [**ICustomForm.Initialize**](/tB/Packages/CustomControls/Framework/ICustomForm.md#initialize) to [**CustomFormContext**](/tB/Packages/CustomControls/Framework/CustomFormContext.md) and stores it; it then exposes its own **Show** method that delegates here:

```tb check_build
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
```

### Close
{: .no_toc }

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

Syntax: *object*.**Close** ( )

Application code typically calls [**WaynesForm.Close**](/tB/Packages/CustomControls/WaynesForm/index.md#close), which in turn calls this method through the stored [**CustomFormContext**](/tB/Packages/CustomControls/Framework/CustomFormContext.md) reference.

## See Also

- [CustomFormContext](/tB/Packages/CustomControls/Framework/CustomFormContext.md) class
- [_CustomControlContext](/tB/Packages/CustomControls/Framework/_CustomControlContext.md) interface
- [ICustomForm](/tB/Packages/CustomControls/Framework/ICustomForm.md) interface
- [CustomControlContext](/tB/Packages/CustomControls/Framework/CustomControlContext.md) class
