# C1.Win.C1Editor.C1Editor.CanRedo

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Editor_C1Editor_CanRedo_" data-uid="C1.Win.C1Editor.C1Editor.CanRedo*">CanRedo Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Editor_C1Editor_CanRedo_" data-uid="C1.Win.C1Editor.C1Editor.CanRedo*"></a>
<h4 id="C1_Win_C1Editor_C1Editor_CanRedo" data-uid="C1.Win.C1Editor.C1Editor.CanRedo">CanRedo()</h4>
<div class="markdown level1 summary"><p>Returns a value that indicates whether the most recent undo action can be redone.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool CanRedo()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CanRedo() As Boolean</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>True if the most recent undo action can be redone; otherwise, False.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Editor_C1Editor_CanRedo_examples">Examples</h5>
<p>This example shows how to create a custom context menu that can be linked to a C1Editor control and has Undo and Redo buttons.
<pre><code class="lang-csharp">class MyContextMenuStrip : ContextMenuStrip
{
private C1Editor _owner;
private ToolStripMenuItem _btnUndo, _btnRedo;
<pre><code>            public MyContextMenuStrip(C1Editor editor)
            {
                // save reference to parent control
                _owner = editor;

                // create menu items
                _btnUndo = (ToolStripMenuItem)Items.Add(&quot;Undo&quot;);
                _btnUndo.ShortcutKeys = Keys.Control | Keys.Z;
                _btnRedo = (ToolStripMenuItem)Items.Add(&quot;Redo&quot;);
                _btnRedo.ShortcutKeys = Keys.Control | Keys.Y;
            }

            protected override void OnItemClicked(ToolStripItemClickedEventArgs e)
            {
                Close();

                if (e.ClickedItem == _btnUndo)
                    _owner.Undo();
                else if (e.ClickedItem == _btnRedo)
                    _owner.Redo();
                base.OnItemClicked(e);
            }

            protected override void OnOpening(System.ComponentModel.CancelEventArgs e)
            {
                _btnUndo.Enabled = _owner.CanUndo;
                _btnRedo.Enabled = _owner.CanCut;
                base.OnOpening(e);
            }&lt;/code&gt;&lt;/pre&gt;
</code></pre>
</code></pre>
</div>
