StringGridで複数行表示

解決


かず  2010-09-07 22:30:42  No: 39105

StringGridのセルに複数行を表示するプログラムをDelphi2007からDelphi2010に移行しようとしましたが、項目の固定行、列は表示がおかしくなります。固定行、列以外は問題なく表示されます。
複数表示はつぎのようです。
//---  StringGrid1複数行の表示
procedure TYoteiIchiranForm.StringGrid1DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  S : String;
  Options : Integer;
begin
  StringGrid1.Canvas.FillRect(Rect);
  S := StringGrid1.Cells[ACol, ARow];
  Rect.Left := Rect.Left + 2;
  Rect.Top  := Rect.Top  + 2;
  Options := DT_EDITCONTROL;
  DrawTextEx(StringGrid1.Canvas.Handle, Pchar(S), Length(S), Rect, Options, nil);
end;


TS  2010-09-07 22:41:23  No: 39106

過去に下記の記事があります。
https://www.petitmonte.com/bbs/answers?question_id=6506


かず  2010-09-08 01:07:37  No: 39107

TSさん
記事の紹介ありがとうございました。
とりあえずDrawingStyleをgdsClassicにして解決としました。


※返信する前に利用規約をご確認ください。

※Google reCAPTCHA認証からCloudflare Turnstile認証へ変更しました。






  このエントリーをはてなブックマークに追加