掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StringGridでExcelの様にコピー元を分かりやすくするには? (ID:26558)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
LineToを使用してなんとか出来ました。 ありがとうございました。 CopyRect は コピー時の座標(TGridRect型) OnDrawcellイベント内 //コピー元及び切り取り元を明示的にする if (CopyRect.Left <= ACol) and (CopyRect.Right >= ACol) and (CopyRect.Top <= ARow) and (CopyRect.Bottom >= ARow) then begin //ペン変更 StringGrid1.Canvas.Pen.Style := psDot; StringGrid1.Canvas.Pen.Color := clBlack; //左 if CopyRect.Left = ACol then begin StringGrid1.Canvas.PenPos := Point(Rect.Left, Rect.Top); StringGrid1.Canvas.LineTo(Rect.Left, Rect.Bottom - 1); end; //右 if CopyRect.Right = ACol then begin StringGrid1.Canvas.PenPos := Point(Rect.Right - 1, Rect.Top); StringGrid1.Canvas.LineTo(Rect.Right - 1, Rect.Bottom - 1); end; //上 if CopyRect.Top = ARow then begin StringGrid1.Canvas.PenPos := Point(Rect.Left, Rect.Top); StringGrid1.Canvas.LineTo(Rect.Right - 1, Rect.Top); end; //下 if CopyRect.Bottom = ARow then begin StringGrid1.Canvas.PenPos := Point(Rect.Left, Rect.Bottom - 1); StringGrid1.Canvas.LineTo(Rect.Right - 1, Rect.Bottom - 1); end; //ペン元に戻す StringGrid1.Canvas.Pen.Style := psSolid; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.