請問如何讓TStringGrid在插入資料時,將新資料放在第一行? |
尚未結案
|
koanchen
一般會員 發表:4 回覆:4 積分:1 註冊:2004-01-02 發送簡訊給我 |
|
ying0515
中階會員 發表:90 回覆:168 積分:81 註冊:2003-01-04 發送簡訊給我 |
|
海星
高階會員 發表:41 回覆:217 積分:106 註冊:2003-01-09 發送簡訊給我 |
|
海星
高階會員 發表:41 回覆:217 積分:106 註冊:2003-01-09 發送簡訊給我 |
|
koanchen
一般會員 發表:4 回覆:4 積分:1 註冊:2004-01-02 發送簡訊給我 |
我曾用了下列的方法嘗試的解決可是會程式當掉
請各位大大幫我看看為什麼吧~ var cnt,i : integer;
begin
StringGrid1.RowCount := StringGrid1.RowCount 1;
cnt := StringGrid1.RowCount;
while (i >= 2 ) do begin
StringGrid1.Cells[0,i] := StringGrid1.Cells[0,i-1];
StringGrid1.Cells[1,i] := StringGrid1.Cells[1,i-1];
StringGrid1.Cells[2,i] := StringGrid1.Cells[2,i-1];
StringGrid1.Cells[3,i] := StringGrid1.Cells[3,i-1];
i := i - 1;
end;
end;
|
00156
高階會員 發表:45 回覆:195 積分:112 註冊:2002-06-01 發送簡訊給我 |
引言: var cnt,i : integer; begin StringGrid1.RowCount := StringGrid1.RowCount 1; i := StringGrid1.RowCount-1; while (i >= 1 ) do begin StringGrid1.Cells[0,i] := StringGrid1.Cells[0,i-1]; StringGrid1.Cells[1,i] := StringGrid1.Cells[1,i-1]; StringGrid1.Cells[2,i] := StringGrid1.Cells[2,i-1]; StringGrid1.Cells[3,i] := StringGrid1.Cells[3,i-1]; i := i - 1; end; end; |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |