Fin*_*ike 15 delphi tstringgrid delphi-xe delphi-xe2
FillRect不会TStringGrid在Delphi XE2中绘制完整的单元格.默认颜色左侧有3个像素的间隙(BiDiMode设置为bdLeftToRight).在我之前使用过的Delphi 6中不存在这个问题.
procedure TShapeline.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
Stringgrid1.Canvas.Brush.Color:=$00FF80FF;
StringGrid1.Canvas.FillRect(Rect);
end;
Run Code Online (Sandbox Code Playgroud)
我试图更改所有属性(包括DrawingStyle)和不同的画笔样式,绘制的矩形不会填充整个单元格.
Uwe*_*abe 18
当DefaultDrawing = true启用主题时,这是XE2中的预期行为(我不会在这里争论好坏 - 正如您可能已经注意到的,RigthToLeft模式的行为是不同的......).
解决方法是检查此条件并Rect.Left在调用前减少4个像素FillRect.
关闭 中的前 4 个选项TStringGrid:
然后它不会绘制网格线,并且您的网格单元将绘制到边缘。刚刚用XE试过了。
| 归档时间: |
|
| 查看次数: |
4927 次 |
| 最近记录: |