Recent

Author Topic: DBDateTimePicker Selection Color  (Read 492 times)

madref

  • Hero Member
  • *****
  • Posts: 1082
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
DBDateTimePicker Selection Color
« on: July 16, 2024, 09:03:06 pm »
i am trying to change the selection color of a DBDateTimePicker and when you use google you find lost of stuff.
also this
Code: Pascal  [Select][+][-]
  1. procedure TForm1.DBDateTimePicker1DrawItem(Sender: TObject; Index: Integer; Rect: TRect; State: TOwnerDrawState);
  2. begin
  3.   if odSelected in State then
  4.   begin
  5.     // Set the selection color
  6.     DBDateTimePicker1.Canvas.Brush.Color := clRed; // Change to your desired color
  7.     DBDateTimePicker1.Canvas.FillRect(Rect);
  8.   end;
  9.   // Draw the text
  10.   DBDateTimePicker1.Canvas.TextOut(Rect.Left, Rect.Top, DBDateTimePicker1.Items[Index]);
  11. end;
  12.  
But the DBDateTimePicker in the trunk version hasn't got any DrawItem.


So how can i change the selection color?


P.s. this is for Windows not for MacOSx and i am using Lazarus 3.99 (rev 85f227d16f) FPC 3.3.1 x86_64-win64-win32/win64
« Last Edit: July 16, 2024, 09:07:12 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Sonoma 14.7
Lazarus 3.99 (Lazarus 3.99 (rev main_3_99-2668-g6b352d830e) FPC 3.3.1 x86_64-darwin-cocoa)

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

madref

  • Hero Member
  • *****
  • Posts: 1082
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: DBDateTimePicker Selection Color
« Reply #1 on: July 18, 2024, 06:25:05 pm »
Anyone?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Sonoma 14.7
Lazarus 3.99 (Lazarus 3.99 (rev main_3_99-2668-g6b352d830e) FPC 3.3.1 x86_64-darwin-cocoa)

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

 

TinyPortal © 2005-2018