コード例 #1
0
        public MainForm()
        {
            InitializeComponent();

            this.ColorSettings();
            this.Icon = Properties.Resources.applicationIcon;
            this.Text = CommonConst.ApplicationName;
            this.ToolStripMenuItem_ItemSetting_Remove.Enabled = false;  // 未実装のため,無効にする。
            _dataManager = new DataManager(CommonConst.DBFileName);
            _spendingOrIncome = 0;
            _isMenuOpened = false;

            this.InitButtonArray();

            // DBから初期設定情報を読み込む。
            _settings = _dataManager.GetMainFormSettings();

            this.SetYearControlValueWithoutEventHandler();

            // 表示月を変えるとコンボボックスの値を変えたことによるイベントが発生し,イベントハンドラが実行される。
            // イベントハンドラの処理により,表示月の家計簿データがDBから読み込まれる。
            this.comboBox_Month.SelectedIndex = _settings.month.Month - 1;

            //this.SetTooltipProperties();
            //this.SetButtonProperties();
            this.AdjustButtonShape();
            this.DrawPlusMark(_dataManager.GetNumberOfKindOfSpendings());
        }
コード例 #2
0
 /// <summary>
 /// メイン画面の初期表示内容を決定するためのパラメータをDBに保存する。
 /// </summary>
 /// <returns></returns>
 public void SetMainFormSettings(MainFormSettings settings)
 {
     _command.CommandText = "update メイン画面設定 ";
     _command.CommandText += "set 設定値='" + settings.month.ToString("yyyy/MM") + "' ";
     _command.CommandText += "where 設定項目='年月'";
     _command.ExecuteNonQuery();
 }