1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | var bmp: TBitmap; LineHeight, TotalHeight: integer; begin // TMemo의 모든 Text가 보이게 세로 늘리기 즉 모든 행이 보이고 세로스크롤바가 비활성화되게 bmp:=TBitmap.Create; try bmp.Canvas.Font.Assign(aMemo.Font); LineHeight:=bmp.Canvas.TextHeight('홍'); TotalHeight:=(aMemo.Lines.Count+2) * LineHeight finally FreeAndNIL(bmp) end; if (aMemo.Tag > 0) and (aMemo.Tag > TotalHeight) then //Tag에 최소 높이를 설정할 수 있다.
aMemo.Height := aMemo.Tag
else
aMemo.Height := TotalHeight;
|
'델파이' 카테고리의 다른 글
DBGrid 컬럼 Width 화면 크기에 따라 자동 변경하기 (0) | 2019.03.05 |
---|---|
TMemo 모든 내용(행, Line) 보이게 세로 크기 늘리기 (0) | 2019.02.15 |
DateSeparator 로케일에 따른 날짜포맷 변경 (0) | 2018.09.15 |
delphi TWebbrowser 의 이미지 뷰 활용, 높이 맞추기, 404에러처리 (0) | 2018.08.18 |
맥어드레스 mac address 구하기 getmac, ipconfig/all (0) | 2018.06.27 |