예제 #1
0
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // Years form...

        private void DropDownYears(object sender, LinkLabelLinkClickedEventArgs e)
        {
            yearsForm = new YearsForm(date.Year);
            var location = PointToScreen(dateLabel.Location);

            location.Offset(0, dateLabel.Height);

            yearsForm.Location    = location;
            yearsForm.Deactivate += DeactivateYears;
            yearsForm.Show(this);
        }
예제 #2
0
        private async void DeactivateYears(object sender, EventArgs e)
        {
            TopMost = false;
            TopMost = true;
            TopMost = false;

            if (yearsForm.Year > 0)
            {
                date = new DateTime(yearsForm.Year, date.Month, 1);
                if (date.CompareTo(DateTime.Now.Date) > 0)
                {
                    date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                }

                await SetMonth(date.Year);
            }

            yearsForm.Dispose();
            yearsForm = null;
        }