请问:在StringGrid控件中,用鼠标同时选择多个单元格时,为何开始的那个单元格始终不显示被选中的蓝色背景?该如何解决?
解决方案 »
- 如何去掉MDI窗口的自带的那3个窗口排列?
- ACM控件,如何设置音量?
- 在用edit或maskedit时,输入数据后回车,如何消出回车键盘按下出现的提示声音?
- 请问订单表中产品序列号的字段由于可能本条产品的数量较多,序列号也就增多,那么序列号这个字段应用什么类型,设多大为好?
- PHOTOSHOP中的字体输出有项特殊功能能使字体四周平滑,请问用DELPHI如何实现。
- 如何选中树结点
- 高手请看
- +++++那有模拟打印机的软件下载? ++++++++
- TestComplete IDispatch问题
- TDataSet和 TCustomADODataSet类的属性,方法,事件,哪儿有找啊?
- 做了个ie工具条,弹出式菜单不能弹出的问题
- 大家好,我是一只菜鸟,请教一下如何在应用程序将图片存储到数据库中。
STRINGGRID。CELL(AROW,ACOL)。BRUSH。COLOR:=CLRED;
相信这样可以的
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var tmp:string;
area:TRect;
i,j:integer;
begin
with StringGrid1.Canvas do
begin
i := StringGrid1.Col;
j := StringGrid1.Row;
Rect := stringgrid1.CellRect(i,j);
FillRect(Rect);
Area := rect;
InflateRect(Area, -2, -2);
tmp := StringGrid1.Cells[i,j];
StringGrid1.Canvas.Brush.Color := clBlue;//设置你想要的颜色;
TextRect(Area,i, j, StringGrid1.Cells[i,j]);
DrawText(Handle, PChar(tmp),length(tmp),Area, DT_CENTER);
end;
end;