2020-06-24 22:25:44 +08:00
|
|
|
|
using System;
|
2020-07-04 14:09:49 +08:00
|
|
|
|
using System.Collections.Generic;
|
2020-06-24 22:25:44 +08:00
|
|
|
|
using System.Text;
|
2020-05-11 21:11:29 +08:00
|
|
|
|
|
|
|
|
|
namespace Sunny.UI.Demo
|
|
|
|
|
{
|
2021-06-22 09:43:13 +08:00
|
|
|
|
public partial class FCheckBox : UIPage
|
2020-05-11 21:11:29 +08:00
|
|
|
|
{
|
|
|
|
|
public FCheckBox()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-07-04 22:27:04 +08:00
|
|
|
|
uiCheckBoxGroup1.SelectedIndexes = new List<int>() { 2, 4 };
|
2020-05-11 21:11:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 22:25:44 +08:00
|
|
|
|
private void uiButton1_Click(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1.SelectAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uiButton2_Click(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1.UnSelectAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uiButton3_Click(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1.ReverseSelected();
|
2020-05-11 21:11:29 +08:00
|
|
|
|
}
|
2020-07-04 14:09:49 +08:00
|
|
|
|
|
|
|
|
|
private void uiButton4_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1.SelectedIndexes = new List<int>() { 2, 4 };
|
|
|
|
|
}
|
2021-03-04 15:22:00 +08:00
|
|
|
|
|
|
|
|
|
private void uiButton5_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1.Clear();
|
|
|
|
|
}
|
2021-04-26 20:52:09 +08:00
|
|
|
|
|
2021-06-22 09:43:13 +08:00
|
|
|
|
private void uiCheckBoxGroup1_ValueChanged(object sender, int index, string text, bool isChecked)
|
|
|
|
|
{
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.Append("SelectedIndexes: ");
|
|
|
|
|
foreach (var selectedIndex in uiCheckBoxGroup1.SelectedIndexes)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(selectedIndex);
|
|
|
|
|
sb.Append(", ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("SelectedIndex: " + index + ", SelectedText: " + text + "\n" + sb.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-26 20:52:09 +08:00
|
|
|
|
private void uiCheckBox1_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(uiCheckBox1.Checked);
|
|
|
|
|
}
|
2021-10-14 22:48:24 +08:00
|
|
|
|
|
|
|
|
|
private void uiButton6_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiCheckBoxGroup1[4] = !uiCheckBoxGroup1[4];
|
|
|
|
|
}
|
2020-05-11 21:11:29 +08:00
|
|
|
|
}
|
2021-06-22 09:43:13 +08:00
|
|
|
|
}
|