如何在StringGrid当前行第一列也像DBGrid样标出箭头呢?
解决方案 »
- 求助:Tile地图编辑器应该怎样做好?
- CheckListBox 不能选中----------------(高人请帮忙)
- Delphi如何结束程序?为什么我的程序窗体结束了,但是程序未能结束?
- 寻找这样一个功能的解决方法~~~~~~~~~~~~CheckBox
- 小软件外包,很简单!
- 大家给点意见,以前我一直用PB做数据库,别的一直用Delphi开发,但是我现在完全想Delphi做,才发现Delphi的数据表现风格太差了。
- 小弟100分求一用quickrep的打印预览窗体.
- 我希望在页面加载时就设定一系列该页面工作环境,该如何做?
- 高分求解一个运动控件的解决方案
- 如何做数据库程序的安装程序?
- Adoquery与oracle的问题!
- 什么情况下需要应用指针?
MY_DRAWCELL = WM_USER + 10;type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyDrawCell(var Msg: TMessage); message MY_DRAWCELL;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if ARow = TStringGrid(Sender).Row then
PostMessage(Handle, MY_DRAWCELL, Rect.Top, 0);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.DefaultRowHeight := 17;
StringGrid1.ColWidths[0] := 11;
end;procedure TForm1.MyDrawCell(var Msg: TMessage);
const
{$J+}vWParam: DWORD = 0;{$J-}
begin
with StringGrid1.Canvas, Msg do
begin
///////Begin 清除上一次的三角
Pen.Color := clBtnFace;
Brush.Color := clBtnFace;
Polygon([
Point(3, vWParam + 3),
Point(8, vWParam + 8),
Point(3, vWParam + 13)
]);
///////End 清除上一次的三角 Pen.Color := clBlack;
Brush.Color := clBlack;
Polygon([
Point(3, WParam + 3),
Point(8, WParam + 8),
Point(3, WParam + 13)
]);
vWParam := WParam;
end;
end;