在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
delphi Firemonkey ListBoxItem自绘 ListBoxItem1的事件ListBoxItem1Paint procedure TForm1.ListBoxItem1Paint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); begin if (Sender as TListBoxItem).IsSelected then begin Canvas.Fill.Kind := TBrushKind.Solid; Canvas.Fill.Color := TAlphaColorRec.Blue; Canvas.FillRect(ARect, 0, 0, [], 1); Canvas.Fill.Kind := TBrushKind.Solid; Canvas.Fill.Color := TAlphaColorRec.White; Canvas.FillText(ARect, (Sender as TListBoxItem).Text, False, 1, [], TTextAlign.Leading, TTextAlign.Center); end else begin Canvas.Fill.Kind := TBrushKind.Solid; Canvas.Fill.Color := TAlphaColorRec.White; Canvas.FillRect(ARect, 0, 0, [], 1); Canvas.Fill.Color := TAlphaColorRec.Black; Canvas.Fill.Kind := TBrushKind.Solid; Canvas.FillText(ARect, (Sender as TListBoxItem).Text, False, 1, [], TTextAlign.Leading, TTextAlign.Center); end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论