public MonthlyDataViewer(DataManager dataManager) { if (dataManager == null) { throw new ArgumentNullException("data"); } InitializeComponent(); _dataManager = dataManager; // DBから初期設定情報を読み込む。 _settings = _dataManager.GetMonthlyDataViewerSettings(); this.RemoveValueChangedEventHandler(); this.comboBox_Month.SelectedIndex = _settings.month.Month - 1; this.chart_Income.Controls.Add(this.label_Income); this.label_Income.Top = this.chart_Income.Top + ((this.chart_Income.Height - this.label_Income.Height) / 2) - 45; this.label_Income.Left = this.chart_Income.Left + ((this.chart_Income.Width - this.label_Income.Width) / 2) - 23; this.chart_Spending.Controls.Add(this.label_Spending); this.label_Spending.Top = this.label_Income.Top; this.button_PrevMonth.BackColor = CommonConst.PrevNextMonthButtonColor; this.button_NextMonth.BackColor = CommonConst.PrevNextMonthButtonColor; this.AdjustButtonShape(); this.numericUpDown_Year.BackColor = CommonConst.MonthControlButtonColor; this.comboBox_Month.BackColor = CommonConst.MonthControlButtonColor; }