# C1.WPF.Ribbon.C1DropDownTool.OnKeyDown

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Ribbon_C1DropDownTool_OnKeyDown_" data-uid="C1.WPF.Ribbon.C1DropDownTool.OnKeyDown*">OnKeyDown Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Ribbon_C1DropDownTool_OnKeyDown_" data-uid="C1.WPF.Ribbon.C1DropDownTool.OnKeyDown*"></a>
<h4 id="C1_WPF_Ribbon_C1DropDownTool_OnKeyDown_System_Windows_Input_KeyEventArgs_" data-uid="C1.WPF.Ribbon.C1DropDownTool.OnKeyDown(System.Windows.Input.KeyEventArgs)">OnKeyDown(KeyEventArgs)</h4>
<div class="markdown level1 summary"><p>Invoked on keyboard key down over C1DropDownTool.
This method overrides UIElement.OnKeyDown and will close the C1DropDownTool menu based on keyboard input.
This prevents focus from getting out of the dropdown if TAB or arrow keys are pressed.
This applies only when the dropdown is open.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">protected override void OnKeyDown(KeyEventArgs e)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Protected Overrides Sub OnKeyDown(e As KeyEventArgs)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.input.keyeventargs">KeyEventArgs</a></td>
      <td><span class="parametername">e</span></td>
      <td><p>Keyboard key associated with the event.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
