diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index aa5065db4b..169fd93ed7 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -1439,6 +1439,7 @@ type procedure AssociateKeyDown(Sender: TObject; var Key: Word; ShiftState : TShiftState); procedure OnAssociateChangeBounds(Sender: TObject); procedure DoOnResize; override; + procedure SetEnabled(Value: Boolean); override; class function GetControlClassDefaultSize: TSize; override; function CanChange: Boolean; virtual; procedure Notification(AComponent: TComponent; Operation: TOperation); override; diff --git a/lcl/include/customupdown.inc b/lcl/include/customupdown.inc index 4712e74638..30b16a135c 100644 --- a/lcl/include/customupdown.inc +++ b/lcl/include/customupdown.inc @@ -130,8 +130,11 @@ var j : integer; begin Inherited Paint; - - Canvas.Pen.Color := clBtnText;//Not perfect, but it works + + if Enabled then + Canvas.Pen.Color := clBtnText //Not perfect, but it works + else + Canvas.Pen.Color := clGrayText; ah := height div 2; aw := width div 2; @@ -393,6 +396,13 @@ begin UpdateOrientation; end; +procedure TCustomUpDown.SetEnabled(Value: Boolean); +begin + MinBtn.Enabled := Value; + MaxBtn.Enabled := Value; + inherited SetEnabled(Value); +end; + class function TCustomUpDown.GetControlClassDefaultSize: TSize; begin Result.CX := 17;