random-file-runner/RyzStudio/Windows/ThemedForms/PickerBox/TYesNoPickerBox.cs

28 lines
675 B
C#
Raw Permalink Normal View History

2021-10-24 15:49:48 +00:00
using RyzStudio.Windows.Forms;
using System.Windows.Forms;
namespace RyzStudio.Windows.ThemedForms
{
public class TYesNoPickerBox : TPickerBox
{
public TYesNoPickerBox() : base()
{
this.ComboBox.Items.Clear();
this.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (this.ComboBox.Items.Count > 0) this.ComboBox.SelectedIndex = 0;
}
public ComboBox InnerControl { get => this.ComboBox; }
public bool Value
{
get => (ThreadControl.GetValue(this.ComboBox) == 1);
set => ThreadControl.SetValue(this.ComboBox, (value ? 1 : 0));
}
}
}