掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StringGrid に入れ子構造を作るには? (ID:30922)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
恐らくやりたいのはこんな事? procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; ARect: TRect; AState: TGridDrawState); var Rect3: TRect; DC: HDC; procedure DrawFrame(ARect:TRect); begin DC := StringGrid1.Canvas.Handle; DrawEdge(DC, ARect, BDR_RAISEDINNER, BF_TOPLEFT); DrawEdge(DC, ARect, BDR_RAISEDINNER, BF_BOTTOMRIGHT); Dec(ARect.Bottom); Dec(ARect.Right); Inc(ARect.Top); Inc(ARect.Left); DrawEdge(DC, ARect, BDR_RAISEDOUTER, BF_TOPLEFT or BF_MIDDLE); end; begin if ARow = 0 then begin if (ARow = 0) and (ACol <> 0) then begin StringGrid1.Canvas.Brush.Color := StringGrid1.FixedColor; if ACol mod 2 = 0 then begin Rect3 := Rect(ARect.Left-StringGrid1.ColWidths[ACol+1],ARect.Top,ARect.Right,ARect.Bottom); end else begin Rect3 := Rect(ARect.Left,ARect.Top,ARect.Right+StringGrid1.ColWidths[ACol+1],ARect.Bottom); end; DrawFrame(Rect3); end; end; if (ACol = 0) then begin StringGrid1.Canvas.Brush.Color := StringGrid1.FixedColor; if ARow mod 2 = 0 then begin Rect3 := Rect(ARect.Left,ARect.Top-StringGrid1.RowHeights[ACol+1],ARect.Right,ARect.Bottom); end else begin Rect3 := Rect(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom+StringGrid1.RowHeights[ACol+1]); end; DrawFrame(Rect3); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.