diff --git a/lcl/interfaces/win32/win32wsspin.pp b/lcl/interfaces/win32/win32wsspin.pp index 8f71eeaab2..2e2dc3a128 100644 --- a/lcl/interfaces/win32/win32wsspin.pp +++ b/lcl/interfaces/win32/win32wsspin.pp @@ -322,7 +322,6 @@ begin WinHandle := AWinControl.Handle; UpDown := GetWin32WindowInfo(WinHandle)^.UpDown; - UpDownWidth := GetUpDownWidth(AWinControl); if (AWinControl as TCustomFloatSpinEdit).BorderStyle = bsNone then BorderWidth := 0 else if (WindowsVersion >= wvXP) and ThemeServices.ThemesEnabled then @@ -330,6 +329,8 @@ begin else BorderWidth := GetSystemMetrics(SM_CXEDGE); + UpDownWidth := (Height - BorderWidth * 2) div 5 * 4 +1 {to get odd number}; // calculate from height to scale it + DWP := BeginDeferWindowPos(2); DeferWindowPos(DWP, UpDown, WinHandle, Left + Width - UpDownWidth - BorderWidth, Top+BorderWidth, UpDownWidth, Height - BorderWidth * 2, SWP_NOACTIVATE);