掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
TStringGridで特定の列のカラム数を変えるには (ID:36758)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
例えば、こんな感じでしょうか? procedure TForm1.FormCreate(Sender: TObject); begin SG1.DefaultColWidth := 40; SG1.DefaultRowHeight := 20; SG1.ColCount := 4; SG1.RowCount := 5; SG1.FixedCols := 0; SG1.FixedRows := 1; SG1.DefaultDrawing := False; // SG1.Rows[0][0] := '時刻'; SG1.Rows[0][1] := '温度'; SG1.Rows[0][2] := '流量'; SG1.Rows[0][3] := '判定'; SG1.Rows[1][0] := '運転開始'; SG1.Rows[1][2] := '通常状態'; SG1.Rows[2][0] := '18:37'; SG1.Rows[2][1] := '135℃'; SG1.Rows[2][2] := '21t'; SG1.Rows[2][3] := '0.1'; SG1.Rows[3][0] := '運転中'; SG1.Rows[3][2] := '臨界状態'; SG1.Rows[4][0] := '20:55'; SG1.Rows[4][1] := '365℃'; SG1.Rows[4][2] := '26t'; SG1.Rows[4][3] := '1.9'; end; procedure TForm1.SG1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var uRect, rRect: TRect; begin uRect := Rect; // if Odd(ARow) then begin if not Odd(ACol) then begin rRect := SG1.CellRect(ACol+1,ARow); Types.UnionRect(uRect,Rect,rRect); SG1.Canvas.FillRect(uRect); end; end; // SG1.Canvas.TextOut(uRect.Left+1,uRect.Top+1,SG1.Cells[ACol,ARow]); end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.