# C1.Win.Input.C1ToggleSwitch

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_Input_C1ToggleSwitch" data-uid="C1.Win.Input.C1ToggleSwitch" class="text-break">C1ToggleSwitch Class
</h1>
  <div class="markdown level0 summary"><p>Represents a check editor that uses a movable bar to edit Boolean values.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject">MarshalByRefObject</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.component">Component</a></div>
    <div class="level3"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control</a></div>
    <div class="level4"><a class="xref" href="../C1.Win.10/C1.Framework.XViewLight.html">XViewLight</a></div>
    <div class="level5"><a class="xref" href="C1.Win.Input.Base.C1InputControl.html">C1InputControl</a></div>
    <div class="level6"><span class="xref">C1ToggleSwitch</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.idroptarget">IDropTarget</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.isynchronizeinvoke">ISynchronizeInvoke</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.iwin32window">IWin32Window</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.ibindablecomponent">IBindableComponent</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.icomponent">IComponent</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="../C1.Win.10/C1.Framework.IView.html">IView</a></div>
    <div><a class="xref" href="../C1.Win.10/C1.Win.Accessibility.ISupportUia.html">ISupportUia</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.isupportinitialize">ISupportInitialize</a></div>
    <div><a class="xref" href="../C1.Win.10/C1.Win.Accessibility.Items.IUiaToggleButton.html">IUiaToggleButton</a></div>
    <div><a class="xref" href="../C1.Win.10/C1.Win.Accessibility.Items.BaseInterfaces.IUiaToggleProvider.html">IUiaToggleProvider</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.Input.html">C1.Win.Input</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.Input.10.dll</h6>
  <h5 id="C1_Win_Input_C1ToggleSwitch_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[DefaultBindingProperty(&quot;Value&quot;)]
[ToolboxBitmap(typeof(C1ToggleSwitch), &quot;C1ToggleSwitch.png&quot;)]
public class C1ToggleSwitch : C1InputControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IView, ISupportUia, ISupportInitialize, IUiaToggleButton, IUiaToggleProvider</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;DefaultBindingProperty(&quot;Value&quot;)&gt;
&lt;ToolboxBitmap(GetType(C1ToggleSwitch), &quot;C1ToggleSwitch.png&quot;)&gt;
Public Class C1ToggleSwitch
    Inherits C1InputControl
    Implements IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IView, ISupportUia, ISupportInitialize, IUiaToggleButton, IUiaToggleProvider</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch__ctor" data-uid="C1.Win.Input.C1ToggleSwitch.#ctor">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.-ctor.html#C1_Win_Input_C1ToggleSwitch__ctor">C1ToggleSwitch()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.html">C1ToggleSwitch</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_BarWidth" data-uid="C1.Win.Input.C1ToggleSwitch.BarWidth">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.BarWidth.html#C1_Win_Input_C1ToggleSwitch_BarWidth">BarWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the width of the switch bar.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Command" data-uid="C1.Win.Input.C1ToggleSwitch.Command">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Command.html#C1_Win_Input_C1ToggleSwitch_Command">Command</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.input.icommand">ICommand</a> whose <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.input.icommand.execute">Execute(object)</a>
method will be called when the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Toggled.html">Toggled</a> event gets invoked.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_CommandParameter" data-uid="C1.Win.Input.C1ToggleSwitch.CommandParameter">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.CommandParameter.html#C1_Win_Input_C1ToggleSwitch_CommandParameter">CommandParameter</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the parameter to pass to the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Command.html#C1_Win_Input_C1ToggleSwitch_Command">Command</a> property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_DefaultSize" data-uid="C1.Win.Input.C1ToggleSwitch.DefaultSize">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.DefaultSize.html#C1_Win_Input_C1ToggleSwitch_DefaultSize">DefaultSize</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_LabelDisplayMode" data-uid="C1.Win.Input.C1ToggleSwitch.LabelDisplayMode">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.LabelDisplayMode.html#C1_Win_Input_C1ToggleSwitch_LabelDisplayMode">LabelDisplayMode</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the display mode to represent the states of the control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_LabelPosition" data-uid="C1.Win.Input.C1ToggleSwitch.LabelPosition">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.LabelPosition.html#C1_Win_Input_C1ToggleSwitch_LabelPosition">LabelPosition</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the position of the text or icons used to display the status of the control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OffIcon" data-uid="C1.Win.Input.C1ToggleSwitch.OffIcon">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OffIcon.html#C1_Win_Input_C1ToggleSwitch_OffIcon">OffIcon</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the icon displayed when the state is Off.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OffText" data-uid="C1.Win.Input.C1ToggleSwitch.OffText">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OffText.html#C1_Win_Input_C1ToggleSwitch_OffText">OffText</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the text displayed when the state is Off.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnIcon" data-uid="C1.Win.Input.C1ToggleSwitch.OnIcon">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnIcon.html#C1_Win_Input_C1ToggleSwitch_OnIcon">OnIcon</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the icon displayed when the state is On.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnText" data-uid="C1.Win.Input.C1ToggleSwitch.OnText">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnText.html#C1_Win_Input_C1ToggleSwitch_OnText">OnText</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the text displayed when the state is On.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Styles" data-uid="C1.Win.Input.C1ToggleSwitch.Styles">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Styles.html#C1_Win_Input_C1ToggleSwitch_Styles">Styles</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.html">C1ToggleSwitch</a> styles.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Text" data-uid="C1.Win.Input.C1ToggleSwitch.Text">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Text.html#C1_Win_Input_C1ToggleSwitch_Text">Text</a>
        </td>
        <td class="markdown level1 summary"><p>This property is not supported by the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.html">C1ToggleSwitch</a> class. Use <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnText.html#C1_Win_Input_C1ToggleSwitch_OnText">OnText</a> and <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OffText.html#C1_Win_Input_C1ToggleSwitch_OffText">OffText</a> properties.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_ThumbWidth" data-uid="C1.Win.Input.C1ToggleSwitch.ThumbWidth">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.ThumbWidth.html#C1_Win_Input_C1ToggleSwitch_ThumbWidth">ThumbWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the width of thumb.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Value" data-uid="C1.Win.Input.C1ToggleSwitch.Value">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Value.html#C1_Win_Input_C1ToggleSwitch_Value">Value</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value of the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.html">C1ToggleSwitch</a> control.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_ApplyStyle" data-uid="C1.Win.Input.C1ToggleSwitch.ApplyStyle">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.ApplyStyle.html#C1_Win_Input_C1ToggleSwitch_ApplyStyle">ApplyStyle()</a>
        </td>
        <td class="markdown level1 summary"><p>Applies the style to control view.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_CreateUiaItem_C1_Win_Accessibility_UiaItem_" data-uid="C1.Win.Input.C1ToggleSwitch.CreateUiaItem(C1.Win.Accessibility.UiaItem)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.CreateUiaItem.html#C1_Win_Input_C1ToggleSwitch_CreateUiaItem_C1_Win_Accessibility_UiaItem_">CreateUiaItem(UiaItem)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates UI Automation object of this control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Dispose_System_Boolean_" data-uid="C1.Win.Input.C1ToggleSwitch.Dispose(System.Boolean)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Dispose.html#C1_Win_Input_C1ToggleSwitch_Dispose_System_Boolean_">Dispose(bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Releases the unmanaged resources used by the <a class="xref" href="C1.Win.Input.Base.C1InputControl.html">C1InputControl</a> control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnClick_System_EventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnClick(System.EventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnClick.html#C1_Win_Input_C1ToggleSwitch_OnClick_System_EventArgs_">OnClick(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.click">Click</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnGotFocus_System_EventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnGotFocus(System.EventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnGotFocus.html#C1_Win_Input_C1ToggleSwitch_OnGotFocus_System_EventArgs_">OnGotFocus(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.gotfocus">GotFocus</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnKeyDown_System_Windows_Forms_KeyEventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnKeyDown(System.Windows.Forms.KeyEventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnKeyDown.html#C1_Win_Input_C1ToggleSwitch_OnKeyDown_System_Windows_Forms_KeyEventArgs_">OnKeyDown(KeyEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.keydown">KeyDown</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnKeyUp_System_Windows_Forms_KeyEventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnKeyUp(System.Windows.Forms.KeyEventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnKeyUp.html#C1_Win_Input_C1ToggleSwitch_OnKeyUp_System_Windows_Forms_KeyEventArgs_">OnKeyUp(KeyEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.keyup">KeyUp</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnMouseUp_System_Windows_Forms_MouseEventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnMouseUp(System.Windows.Forms.MouseEventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnMouseUp.html#C1_Win_Input_C1ToggleSwitch_OnMouseUp_System_Windows_Forms_MouseEventArgs_">OnMouseUp(MouseEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.mouseup">MouseUp</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_OnToggled_System_EventArgs_" data-uid="C1.Win.Input.C1ToggleSwitch.OnToggled(System.EventArgs)">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.OnToggled.html#C1_Win_Input_C1ToggleSwitch_OnToggled_System_EventArgs_">OnToggled(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Toggled.html">Toggled</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Toggle" data-uid="C1.Win.Input.C1ToggleSwitch.Toggle">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Toggle.html#C1_Win_Input_C1ToggleSwitch_Toggle">Toggle()</a>
        </td>
        <td class="markdown level1 summary"><p>Inverts the state of the ToggleSwitch control only when the control is enabled.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Input_C1ToggleSwitch_Toggled" data-uid="C1.Win.Input.C1ToggleSwitch.Toggled">
          <a class="xref" href="C1.Win.Input.C1ToggleSwitch.Toggled.html">Toggled</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the control's state is changed.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
