關鍵字:Delphi StringGrid
如何實現在stringgrid中刪除鼠標點中的那一行,下一行再頂上的效果? procedure TForm1.Button1Click(Sender: TObject);
var
Sel : TGridRect;
begin
Sel := StringGrid1.Selection;
DeleteRow(Sel.Top);
end;
// delete row
procedure TForm1.DeleteRow(Row: Integer);
var
i : integer;
begin
if (Row < StringGrid1.RowCount) and (Row > Stringgrid1.FixedRows-1) then
if Row < StringGrid1.RowCount - 1 then
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/