Example #1
0
        internal static void UpdatePanelAppearance(XtraTabPage tabPage, bool customLineNumbersVisible)
        {
            CustomRichTextBox pageTextBox       = ProgramUtil.GetPageTextBox(tabPage);
            CustomLineNumbers customLineNumbers = ProgramUtil.GetCustomLineNumbers(tabPage);
            CustomPanel       columnRulerPanel  = (CustomPanel)tabPage.Controls["columnRulerPanel"];

            if (columnRulerPanel == null)
            {
                return;
            }

            pageTextBox.Size = new Size(pageTextBox.Size.Width + 1, pageTextBox.Size.Height);
            pageTextBox.Size = new Size(pageTextBox.Size.Width - 1, pageTextBox.Size.Height);
            RichTextBox columnRulerTextBox = (RichTextBox)columnRulerPanel.Controls["columnRulerTextBox"];

            columnRulerTextBox.Width = pageTextBox.Width + 1;
            columnRulerTextBox.Left  = customLineNumbersVisible ? customLineNumbers.Width : 0;
            //columnRulerPanel.MarginLeftHorizontalLine = tabPage.Width - columnRulerTextBox.Width - 5;
            columnRulerPanel.MarginLeftHorizontalLine = columnRulerTextBox.Left;
            columnRulerPanel.Refresh();
        }