* UIRadioButtonGroup: 内置条目关联值由Tag改为TagString

* UICheckBoxGroup: 内置条目关联值由Tag改为TagString
This commit is contained in:
Sunny 2023-06-27 22:23:03 +08:00
parent 834ba6a46d
commit 6ed6ec9afa
2 changed files with 6 additions and 4 deletions

View File

@ -23,6 +23,7 @@
* 2022-06-30: V3.2.0 * 2022-06-30: V3.2.0
* 2022-11-21: V3.2.9 * 2022-11-21: V3.2.9
* 2023-04-19: V3.3.5 ForeColor * 2023-04-19: V3.3.5 ForeColor
* 2023-06-27: V3.3.9 Tag改为TagString
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -141,7 +142,7 @@ namespace Sunny.UI
box.BackColor = Color.Transparent; box.BackColor = Color.Transparent;
box.Font = Font; box.Font = Font;
box.Parent = this; box.Parent = this;
box.Tag = i; box.TagString = i.ToString();
box.Style = Style; box.Style = Style;
box.IsScaled = IsScaled; box.IsScaled = IsScaled;
box.ValueChanged += Box_ValueChanged; box.ValueChanged += Box_ValueChanged;
@ -195,7 +196,7 @@ namespace Sunny.UI
if (!multiChange) if (!multiChange)
{ {
ValueChanged?.Invoke(this, checkBox.Tag.ToString().ToInt(), checkBox.Text, checkBox.Checked); ValueChanged?.Invoke(this, checkBox.TagString.ToInt(), checkBox.Text, checkBox.Checked);
} }
} }

View File

@ -22,6 +22,7 @@
* 2020-07-04: V2.2.6 * 2020-07-04: V2.2.6
* 2022-11-21: V3.2.9 * 2022-11-21: V3.2.9
* 2023-04-22: V3.3.5 ForeColor * 2023-04-22: V3.3.5 ForeColor
* 2023-06-27: V3.3.9 Tag改为TagString
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -107,7 +108,7 @@ namespace Sunny.UI
BackColor = Color.Transparent, BackColor = Color.Transparent,
Font = Font, Font = Font,
Parent = this, Parent = this,
Tag = i, TagString = i.ToString(),
Style = Style, Style = Style,
IsScaled = IsScaled, IsScaled = IsScaled,
Text = Items[i]?.ToString(), Text = Items[i]?.ToString(),
@ -161,7 +162,7 @@ namespace Sunny.UI
UIRadioButton button = (UIRadioButton)sender; UIRadioButton button = (UIRadioButton)sender;
if (value) if (value)
{ {
SelectedIndex = button.Tag.ToString().ToInt(); SelectedIndex = button.TagString.ToInt();
} }
} }