📄 roomstatus.~pas
字号:
unit RoomStatus;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, ImgList, ExtCtrls;
type
TRoomSta = class(TForm)
ImageList1: TImageList;
GroupBox1: TGroupBox;
StringGrid1: TStringGrid;
GroupBox2: TGroupBox;
Button1: TButton;
GroupBox3: TGroupBox;
RadioButton1: TRadioButton;
Image1: TImage;
Image2: TImage;
RadioButton2: TRadioButton;
Image3: TImage;
RadioButton3: TRadioButton;
Image4: TImage;
RadioButton4: TRadioButton;
Image5: TImage;
RadioButton5: TRadioButton;
Image6: TImage;
RadioButton6: TRadioButton;
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
RoomSta: TRoomSta;
implementation
{$R *.dfm}
procedure TRoomSta.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
bitmap:TBitmap;
begin
if (Acol = 1) and (arow = 1) then //判断你的条件
begin
with Sender as TStringGrid do
begin
bitmap:=TBitmap.Create;
imagelist1.GetBitmap(0,bitmap);
stringgrid1.Canvas.StretchDraw(Rect,bitmap);
bitmap.Free;
end;
end;
end;
procedure TRoomSta.Button1Click(Sender: TObject);
var
bitmap:Tbitmap;
begin
stringgrid1.Cells[1,2]:='001';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -