UIDatePicker: 修复年份选择Bug

This commit is contained in:
Sunny 2020-05-30 20:06:56 +08:00
parent 237972ee8d
commit 90daa5b401
4 changed files with 8 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1616,13 +1616,13 @@ namespace Sunny.UI
switch (TabControl.SelectedIndex) switch (TabControl.SelectedIndex)
{ {
case 0: case 0:
int iy = year / 10 * 10; Year = year / 10 * 10;
iy -= 10; Year -= 10;
TopPanel.Text = iy + "年 - " + (iy + 9) + "年"; TopPanel.Text = Year + "年 - " + (Year + 9) + "年";
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
{ {
UILabel label = tabPage1.GetControl<UILabel>("y" + i); UILabel label = tabPage1.GetControl<UILabel>("y" + i);
label.Text = (iy + i - 1).ToString(); label.Text = (Year + i - 1).ToString();
} }
break; break;
@ -1661,13 +1661,13 @@ namespace Sunny.UI
switch (TabControl.SelectedIndex) switch (TabControl.SelectedIndex)
{ {
case 0: case 0:
int iy = year / 10 * 10; Year = year / 10 * 10;
iy += 10; Year += 10;
TopPanel.Text = iy + "年 - " + (iy + 9) + "年"; TopPanel.Text = Year + "年 - " + (Year + 9) + "年";
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
{ {
UILabel label = tabPage1.GetControl<UILabel>("y" + i); UILabel label = tabPage1.GetControl<UILabel>("y" + i);
label.Text = (iy + i - 1).ToString(); label.Text = (Year + i - 1).ToString();
} }
break; break;