假如在stringgrid中的一个cells[2,2]有字符窜'321',怎么将这个格的背景改为clgreen,字符串黑字体正常显示,而且通过stringgrid.cells[2,2]还能返回'321'.
解决方案 »
- 那里有可以连接电脑控制声光报警设备
- delphi7有关C8051F340与PC的USB通讯的问题:
- 假如启动了多个Ie,怎样区别(获得)激活的是哪一个?
- 数组的简单问题
- 查询记录
- MessageBox的问题!!!!!应该是很简单,可是俺不会:(
- delphi+dbexpress+mysql 提示:"unable load libmysql.dll" 是何原因??
- 请问哪个地方有中文汉化的DELPHI6帮助下载?
- Pardox数据库Number型字段小数点位数问题.(初学者的献礼)
- ~~~关于泛类型TList<>赋值的疑惑,求教~~~
- delphi里用ado连接数据库时怎样做事物处理
- [救助]请大家帮我解决一个小问题,我是delphi初学者,谢谢了!
begin
stringgrid1.cells[2,2]:='321';
end;procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (ACol=2) and (ARow=2) then
begin
With StringGrid1 do
begin
canvas.Brush.Color:= clGreen;
Canvas.FillRect(Rect);
Canvas.Font.Color:=clBlack;
Canvas.TextOut(Rect.Left+2,Rect.Top+2,'321');
end;
end;
end;