작성해놓은 소스 코드는 없구요.. 그리고, 상당히 손이 많이 가는 작업이라서, 이런 작업을 해놓은 것들은 대부분 컴포넌트로 배포되고 있습니다.
아래 컴포넌트도 꽤 괜찮구요..
http://www.delphi-gems.com/VirtualTreeview/VT.html
제일 문제가 TreeNode의 Width를 조절할 수 있는 프로퍼티가 없다는 것인데, 메시지를 이용해서 조작이 가능합니다. 아래는 뉴스그룹에서 관한 기사구요.
As long the target platform has comctl32 of at 4.71 (IE4+), then you can use the
TVM_SETITEM message with the TVITEMEX structure. Specifically, the TVITEMEX
structure has an iIntegral data member that you can use to set per-node
heights. Here's a quick example of setting the height of the selected node to 3
times the default height...
#include <cassert>
TTreeNode* pItem = TreeView1->Selected;
assert(pItem != NULL);
TVITEMEX tvix;
tvix.mask = TVIF_INTEGRAL | TVIF_HANDLE;
tvix.hItem = pItem->ItemId;
tvix.iIntegral = 3; // 3x height
const int res = SNDMSG(
TreeView1->Handle, TVM_SETITEM, 0,
reinterpret_cast<LPARAM>(&tvix)
);
assert(res != 0);
TreeView1->Invalidate();
You might also want to use the TVM_SETITEMHEIGHT message to set the default
height (the iIntegral data member will then specify multiples of that height)...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/treeview/messages/tvm_setitemheight.asp
Good luck,
--
Damon C. (TeamB)
유영인.Chris 님이 쓰신 글 :
: 위와 같은 경우에는, ListView를 사용하시기 보다 HeaderControl을 사용하시는 것이 좋을것 같습니다.
:
: HeaderControl을 하나 놓으신 다음에 더블클릭을 하시면, Report 형식의 ListView 처럼 열을 꾸미실 수가 있습니다.
:
: 그 다음, TreeView의 열의 너비를 시작할때와 HeaderControl의 각각의 열의 Width를 조절할 때마다 바꿔 주시면 될 것 같습니다.
:
:
:
: Monkey D Ruphy 님이 쓰신 글 :
: : 아래 첨부파일과 같이 하려고 하는데 조언좀 부탁드립니다..(__)