diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBox.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBox.cs index 5f29b798482..e9ccffc7e4f 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBox.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBox.cs @@ -440,7 +440,14 @@ private protected override Padding GetScrollBarPadding() if (Multiline && (_scrollBars & ScrollBars.Vertical) != 0) { - padding.Right = SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + if (RightToLeft == RightToLeft.Yes) + { + padding.Left = SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + } + else + { + padding.Right = SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + } } return padding; diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs index 390dc9aa53c..021b73554da 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs @@ -1028,7 +1028,18 @@ private protected virtual Padding GetScrollBarPadding() if (hasVScroll) { - padding.Right += SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + WINDOW_EX_STYLE exStyle = (WINDOW_EX_STYLE)PInvokeCore.GetWindowLong( + this, + WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE); + + if ((exStyle & WINDOW_EX_STYLE.WS_EX_LEFTSCROLLBAR) != 0) + { + padding.Left += SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + } + else + { + padding.Right += SystemInformation.GetVerticalScrollBarWidthForDpi(DeviceDpiInternal); + } } return padding;