Exemple #1
0
        /// <summary>
        /// スクロールバー設定。
        /// </summary>
        private void SettingScroll()
        {
            settingVScroll();
            settingHScroll();

            // 垂直スクロール設定
            void settingVScroll()
            {
                var viewportLength = TextArea.ClientSize.Height / GetLineHeight();

                viewportLength = MathUtil.ClampMin(viewportLength, 1);
                VScrollBar.SettingScrollByContentLength(TextArea.VContentLength, 1, viewportLength);
            }

            // 水平スクロール設定
            void settingHScroll()
            {
                var viewportLength = TextArea.ClientSize.Width / HScrollStep;

                viewportLength = MathUtil.ClampMin(viewportLength, 1);
                HScrollBar.SettingScrollByContentLength(TextArea.HContentLength, 1, viewportLength);
            }
        }