zoukankan      html  css  js  c++  java
  • delphi Firemonkey ListBoxItem自绘

    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;
  • 相关阅读:
    CSS margin合并
    最大网络流
    js——this
    js——作用域和闭包
    CSS弹性(flexible)盒子
    CSS盒子模型
    修改html中button显示的文字
    远程唤醒UP Board
    UP Board 串口使用心得
    UP Board 网络设置一本通
  • 原文地址:https://www.cnblogs.com/cb168/p/5500756.html
Copyright © 2011-2022 走看看