StringGrid 下横线问题 如何让
StringGrid1.Row:=5;
StringGrid1.Col:=6;
如何控制以上的StringGrid1 双下横线 和单下横线啊 就是说 我想让哪个格格的字体为 单下横线 和双下横线呢 ???
如果没办法实现 那有其它控件吗????????????? 谢谢
StringGrid1.Row:=5;
StringGrid1.Col:=6;
如何控制以上的StringGrid1 双下横线 和单下横线啊 就是说 我想让哪个格格的字体为 单下横线 和双下横线呢 ???
如果没办法实现 那有其它控件吗????????????? 谢谢
解决方案 »
- 调用一个文件,改用相对路径存在的问题?
- [100分急求]RichEdit字体格式问题
- delphi编译出来的exe文件突然变的很大
- 出错信息“无效的书签”?????????????
- 如何运行时绑定adodataset中的数据到fastreport中
- 白痴问题十六进制转换十进制
- 怎样删除动态数组中的某个元素?
- 批量增加记录,用append快,还是SQL的insert 快?
- 有关注册表加一个dword值iniregedit.WriteString('Software\Microsoft\Windows\CurrentVersion\Policies','System','DisableRegistryTool
- 请问哪里有Borland delphi 5.0 standard下载
- 想实现一些控件(如:Groupbox)的Canvas,搜索了一下论坛居然没有发现,只好提问了,给了思路或例子,谢谢!
- 查询到的数据不能修改?
Rect: TRect; State: TGridDrawState);
begin
if (ACol = 2) and (Arow = 2) then
begin
StringGrid1.Canvas.Font.Style := [fsUnderLine];
StringGrid1.Canvas.TextRect(Rect,Rect.Left + 2,Rect.Top + 2,StringGrid1.Cells[ACol,ARow]);
end;
end;
Rect: TRect; State: TGridDrawState);
begin
if (ACol = 2) and (Arow = 2) then
begin
StringGrid1.Canvas.Font.Style := [fsUnderLine];
StringGrid1.Canvas.TextRect(Rect,Rect.Left + 2,Rect.Top + 2,StringGrid1.Cells[ACol,ARow]);
end;
end;
但有变通方法,算出字体的最下部分的坐标,然后用MoveTo,LineTo再画一条线。
Rect: TRect; State: TGridDrawState);
begin
if (ACol = 2) and (Arow = 2) then
begin
StringGrid1.Canvas.Font.Style := [fsUnderLine];
StringGrid1.Canvas.TextRect(Rect,Rect.Left + 2,Rect.Top + 2,StringGrid1.Cells[ACol,ARow]);
end;
if (ACol = 3) and (ARow = 3) then
With StringGrid1.Canvas do
begin
Font.Style := [fsUnderLine];
TextRect(Rect,Rect.Left + 2,Rect.Top + 2,StringGrid1.Cells[ACol,ARow]);
//画多一条线
MoveTo(Rect.Left + 2,Rect.Top + 3 + TextHeight(StringGrid1.Cells[ACol,ARow]));
Pen.Color := ClBlack;
LineTo(Rect.Left + 2 + TextWidth(StringGrid1.Cells[ACol,ARow]),Rect.Top + 3 + TextHeight(StringGrid1.Cells[ACol,ARow]));
end;
end;