# TextControl.MiniToolbarOpening Event

> Occurs to handle displaying context sensitive mini toolbars. The event handler receives an argument of type WPF.MiniToolbarOpeningEventArgs containing data related to this event. The event itself is raised if the ShowMiniToolbar property is set to a value that is not MiniToolbarButton.None and the corresponding mouse button is raised.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Event
- **Introduced:** 25.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.MiniToolbarOpening Event
- **604 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/minitoolbaropening-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/minitoolbaropening-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/minitoolbaropening-event/llms-full.txt

---

### Description

Occurs to handle displaying [context sensitive](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/wpf-minitoolbaropeningeventargs/minitoolbarcontext-property/llms-full.txt) [mini toolbars](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/wpf-minitoolbar/llms-full.txt). The event handler receives an argument of type [WPF.MiniToolbarOpeningEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/wpf-minitoolbaropeningeventargs/llms-full.txt) containing data related to this event. The event itself is raised if the [ShowMiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/showminitoolbar-property/llms-full.txt) property is set to a value that is not `MiniToolbarButton.None` and the corresponding mouse button is raised.

### Syntax

```csharp
public event MiniToolbarOpeningEventHandler MiniToolbarOpening;
```

```vbnet
Public Event MiniToolbarOpening As MiniToolbarOpeningEventHandler
```

### Examples

The following example records useful context when mini toolbar opening occurs.

```csharp
textControl.MiniToolbarOpening += (sender, e) =>
{
    Console.WriteLine($"Mini Toolbar Context: {e.MiniToolbarContext}");
};
```

```vbnet
AddHandler textControl.MiniToolbarOpening,
    Sub(sender, e)
        Console.WriteLine($"Mini Toolbar Context: {e.MiniToolbarContext}")
    End Sub
```

### Remarks

It is recommended to handle this event for toggling the visibility of added or built-in context sensitive items of the [WPF.TextMiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textminitoolbar/llms-full.txt) or [WPF.ObjectMiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/objectminitoolbar/llms-full.txt). Determining their structure should be handled by the [WPF.TextControl.TextMiniToolbarInitialized](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textminitoolbarinitialized-event/llms-full.txt) or [WPF.TextControl.ObjectMiniToolbarInitialized](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/objectminitoolbarinitialized-event/llms-full.txt) event. Furthermore the [WPF.MiniToolbarOpeningEventArgs.MiniToolbar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/wpf-minitoolbaropeningeventargs/minitoolbar-property/llms-full.txt) property can be used as an interface to set custom context sensitive mini toolbars.

---

## Nearby

- **Previous:** [TextControl.ManageConditionalInstructionsDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/manageconditionalinstructionsdialog-method/llms-full.txt)
- **Next:** [TextControl.MisspelledWords Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/misspelledwords-property/llms-full.txt)
