protected virtual void OnTabButtonClick(object sender, EventArgs e) { try { if (sender != null) { CustomButtonBase button = (CustomButtonBase)sender; int index = tabButtons.IndexOf(button); if (0 <= index && index < tabPanelList.Count && !button.Selected) { SelectPanel(index); if (TabChanged != null && selected >= 0) { TabChanged(sender, e); } } } } catch (Exception ex) { const string THIS_PROC = "CustomTabBase.OnTabButtonClick"; //ログ出力 LogProc.WriteLog(LogProc.LOG_KIND_DEBUG, THIS_PROC, ex); } }
/// <summary> /// すでに登録されているタブボタンにサブページを追加する(タブボタン指定) /// (一つのタブボタンの中でページ制御をする場合に使用する) /// (サブページの切替はフォーム側のプログラムで行う。) /// (タブボタンによる画面遷移では、サブページがあっても必ず最初のページを表示) /// </summary> /// <param name="button">すでに登録されているタブボタンオブジェクト</param> /// <param name="panel">サブページとして登録するパネルオブジェクト</param> /// <returns>実際に登録されたサブページ番号(エラー時は-1)</returns> public int AddSubPanel(CustomButtonBase button, UserControl panel) { return(AddSubPanel(tabButtons.IndexOf(button), panel)); }
/// <summary> /// ラジオボタン追加 /// </summary> /// <param name="button"></param> public void AddButton(CustomButtonBase button) { button.Tag = buttons.Count.ToString(); button.Click += new EventHandler(selectionMouseClick); buttons.Add(button); }