Esempio n. 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// MenuTabControl_Selecting
        ///
        /// <summary>
        /// MenuTabControl のタブが選択される前に実行されるハンドラです。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void TabControl_Selecting(object sender, TabControlCancelEventArgs e)
        {
            SearchPanel.SuspendLayout();
            switch (e.TabPage.Name)
            {
            case nameof(SearchTabPage):
                ReplaceTabPage.Controls.Remove(SearchPanel);
                EnableReplaceControls(false);
                OptionalButton1.Text = Properties.Resources.SearchPrev;
                OptionalButton2.Text = Properties.Resources.SearchNext;
                SearchTabPage.Controls.Add(SearchPanel);
                break;

            case nameof(ReplaceTabPage):
                SearchTabPage.Controls.Remove(SearchPanel);
                EnableReplaceControls(true);
                OptionalButton1.Text = Properties.Resources.ReplaceNext;
                OptionalButton2.Text = Properties.Resources.ReplaceAll;
                ReplaceTabPage.Controls.Add(SearchPanel);
                break;

            default:
                break;
            }
            SearchPanel.ResumeLayout();
        }
Esempio n. 2
0
        /* ----------------------------------------------------------------- */
        ///
        /// SearchPanel_Resize
        ///
        /// <summary>
        /// ReplacePanel のリサイズ時に実行されるハンドラです。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void SearchPanel_Resize(object sender, EventArgs e)
        {
            SearchPanel.SuspendLayout();
            var width = SearchPanel.Width - SearchPanel.Padding.Right;

            SetWidth(ButtonsPanel, width);
            SetWidth(ConditionPanel, width);
            SearchPanel.ResumeLayout();
        }