掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Delphi Q&A掲示板について (ID:8)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
StringGrid1そのものの印刷です。 Printer.begindoc; StringGrid1.PaintTo(Printer.Handle,1,1); Printer.enddoc; 最初のカーソルの位置(青い部分)を書き直す。 StringGrid1OptionのgoDrawFocusSelectedを外す。 procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin with TStringGrid( Sender ).Canvas do begin if Flg and ( gdSelected in State ) then //FlgはBoolreanでOnCreateでTrueにする begin Brush.Color := TStringGrid( Sender ).Color; Font.Color := TStringGrid( Sender ).Font.Color; Flg := false; FillRect( Rect ); OffSetRect( Rect, 0, 2 ); //文字描画位置の調整 DrawText( Handle, PChar( TStringGrid( Sender ).Cells[ ACol, ARow ] ), -1, Rect, DT_CENTER ); end; end; end; 選択範囲のセル内容を''にする。 var I,J : Integer; begin with StringGrid1 do for I := Selection.Top to Selection.Bottom do for J := Selection.Left to Selection.Right do Cells[J, Col] := ''; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.