Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The proper syntax is:</p> <pre><code>SendKeys.Send("+{Tab}"); </code></pre> <p>In light of your comment that you are trying to implement pressing <code>Shift+Tab</code> to cycle between control fields, note that this can be done more reliably without emulating keys. This avoids issues where, for instance, another window has focus.</p> <p><strike> The following method will emulate the behavior of Shift_Tab, cycling through tab stops in reverse order:</p> <pre><code>void EmulateShiftTab() { // get all form elements that can be focused var tabcontrols = this.Controls.Cast&lt;Control&gt;() .Where(a =&gt; a.CanFocus) .OrderBy(a =&gt; a.TabIndex); // get the last control before the current focused element var lastcontrol = tabcontrols .TakeWhile(a =&gt; !a.Focused) .LastOrDefault(a =&gt; a.TabStop); // if no control or the first control on the page is focused, // select the last control on the page if (lastcontrol == null) lastcontrol = tabcontrols.LastOrDefault(); // change focus to the proper control if (lastcontrol != null) lastcontrol.Focus(); } </code></pre> <p></strike></p> <p><strong>Edit</strong></p> <p>The deleted text will cycle through controls in reverse order (emulating shift+Tab), but this is more properly done with with the built-in <code>Form.SelectNextControl</code> method. The following method will emulate the behavior of Shift_Tab, cycling through tab stops in reverse order.</p> <pre><code>void EmulateShiftTab() { this.SelectNextControl( ActiveControl, forward: false, tabStopOnly:true, nested: true, wrap:true); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload