Skip to content

Commit

Permalink
Merge pull request #5 from DigitalPlatform/master
Browse files Browse the repository at this point in the history
同步源
  • Loading branch information
renyh1013 committed Jan 13, 2016
2 parents 63593cc + eeecda7 commit b92f23c
Show file tree
Hide file tree
Showing 151 changed files with 6,876 additions and 16,096 deletions.
26 changes: 26 additions & 0 deletions DigitalPlatform.CommonControl/DateRangeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public partial class DateRangeControl : UserControl
public DateRangeControl()
{
InitializeComponent();

this.dateTimePicker_start.Value = this.dateTimePicker_start.MinDate;
this.dateTimePicker_end.Value = this.dateTimePicker_end.MinDate;
RefreshDisplay(this.dateTimePicker_start);
RefreshDisplay(this.dateTimePicker_end);
}

public override Size MaximumSize
Expand Down Expand Up @@ -156,6 +161,8 @@ public static DateTime Long8ToDateTime(string strDate8)

private void dateTimePicker_start_ValueChanged(object sender, EventArgs e)
{
RefreshDisplay(this.dateTimePicker_start);

if (IngoreTextChange > 0)
return;

Expand All @@ -165,8 +172,18 @@ private void dateTimePicker_start_ValueChanged(object sender, EventArgs e)
}
}

void RefreshDisplay(DateTimePicker picker)
{
if (picker.Value == picker.MinDate)
picker.CustomFormat = " ";
else
picker.CustomFormat = "yyyy-MM-dd";
}

private void dateTimePicker_end_ValueChanged(object sender, EventArgs e)
{
RefreshDisplay(this.dateTimePicker_end);

if (IngoreTextChange > 0)
return;

Expand Down Expand Up @@ -241,10 +258,19 @@ private void label_start_MouseUp(object sender, MouseEventArgs e)
menuItem.MenuItems.Add(subMenuItem);
}

menuItem = new MenuItem("清空");
menuItem.Click += menu_clear_Click;
contextMenu.MenuItems.Add(menuItem);

contextMenu.Show(this.label_start, new Point(e.X, e.Y));
}

void menu_clear_Click(object sender, EventArgs e)
{
this.dateTimePicker_start.Value = this.dateTimePicker_start.MinDate;
this.dateTimePicker_end.Value = this.dateTimePicker_end.MinDate;
}

void menu_quickSet_Click(object sender, EventArgs e)
{
MenuItem menu = (MenuItem)sender;
Expand Down
2 changes: 1 addition & 1 deletion DigitalPlatform.CommonControl/GetDateDlg.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b92f23c

Please sign in to comment.