⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fillcolor.pas

📁 delphi LED 显示屏用,带串口发送,内容编辑,演示功能
💻 PAS
字号:
unit fillcolor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TFormfill = class(TForm)
    Panel1: TPanel;
    ComboBox2: TComboBox;
    ComboBox1: TComboBox;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ComboBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    select:integer;
  end;

var
  Formfill: TFormfill;

const
   SCREENCOLOR:array[0..2] of int64=($ff,$ff00,$ffff);

implementation

{$R *.dfm}

procedure TFormfill.Button1Click(Sender: TObject);
begin
    select:=1;
    close;
end;


procedure TFormfill.Button2Click(Sender: TObject);
begin
    select:=0;
    close;
end;

procedure TFormfill.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
     Arect:Trect;
begin
     Arect.Left:=rect.Left+5;
     Arect.Top:=rect.Top+2;
     Arect.Right:=rect.Left+25;
     Arect.Bottom:=rect.Bottom-2;
     ComboBox1.Canvas.Brush.color:=SCREENCOLOR[index];
     ComboBox1.Canvas.fillrect(Arect);
     ComboBox1.Canvas.Brush.color:=$ffffff;
     ComboBox1.Canvas.Font.Color:=0;
     ComboBox1.Canvas.TextOut(rect.left+30,rect.top,ComboBox1.items[index]);
end;

procedure TFormfill.FormCreate(Sender: TObject);
begin
     ComboBox1.ItemIndex:=0;
     ComboBox2.ItemIndex:=0;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -