# Showing a Dialog Form when a Message Filter is not Installed

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



[C1Command](/componentone/docs/win/online-menus-toolbar/)’s Menus and Toolbars rely on installing a message filter (implementing the IMessageFilter interface) to implement main menu and some other functionality. In some cases (for example, when [C1Command](/componentone/docs/win/online-menus-toolbar/) is used in a component's designer, and is run in Visual Studio's design time), installing a message filter does not work. In such cases, [C1Command](/componentone/docs/win/online-menus-toolbar/) can still be used.

The following code fragment demonstrates how to show a dialog box when a message filter could not be installed. You can use this approach, for example, if you want to show a dialog box in your component's designer.

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Imports C1.Win.C1Command;
    C1CommandHolder.UninstallMessageFilter() 
    'Create the C1CommandMsgHook
    Dim hook As New C1CommandMsgHook()
    hook.Install()
    Try 
        result = dialog.ShowDialog()
    Finally
                Hook.Uninstall();
    End Try
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
using C1.Win.C1Command;
        ...
        C1CommandHolder.UninstallMessageFilter();
        C1CommandMsgHook hook = new C1CommandMsgHook();
        hook.Install();
        try 
        {
          result = dialog.ShowDialog();
        }
        finally
        {
          hook.Uninstall();
        }
```

DOC-DETAILS-TAG-CLOSE

## See Also

[Wrapping Items at the End of the Menu](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/menutasks/wrappingitemsattheen)