掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StringGridセル結合後のセル間ボーダーラインについて (ID:9999)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
>ちなみに、StringGridの[DefaultDrawing]プロパティは「True」に設定しています。 >結合したセル間の不要な線をどのように非表示にしたらよいのか 答えはカンタン。DefaultDrawingプロパティを False にすること。 ん?それではo(コマル)? ナンのためのOwnerDrawじゃい。 >・[0行 1列目と2列目]のセル結合SRC >Canvas.Brush.Color := clBtnFace; もしかして…DefaultDrawingをTrueにしたままで 固定行のセルを結合したいということかな? procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin with TStringGrid(Sender) do begin DefaultDrawing := True; // [0行 1列目と2列目]の固定セルの結合 if gdFixed in State then begin DefaultDrawing := False; case ACol of 1 : Rect.Right := Rect.Right + ColWidths[2]; 2 : Rect.Left := Rect.Left - ColWidths[1] - 1; end; Canvas.Brush.Color := clBtnFace; Canvas.Font.Color := clBlack; Canvas.FillRect(Rect); DrawEdge(Canvas.Handle, Rect, BDR_RAISEDINNER, BF_RECT); DrawText(Canvas.Handle, PChar(Cells[ACol, ARow]), -1, Rect, DT_SINGLELINE or DT_CENTER or DT_VCENTER); end; end; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.