我刚刚开始学习VC,请问CTreeCtrl与CTreeView有什么区别呀?(100分)

  • 主题发起人 主题发起人
  • 开始时间 开始时间

Unregistered / Unconfirmed
GUEST, unregistred user!
我刚刚开始学习VC,请问CTreeCtrl与CTreeView有什么区别呀?
 
不看书吗? google先!
 
CTreeView是VC++裡面的試圖類,在文檔/試圖結構應用程序裡面,簡單的實現TreeView的樣式,就象WINDOWS裡面的資源管理器那樣的樣式(左邊包含目錄樹)。
CTreeCtrl是一個控件類,它象其他普通控件那樣可以在窗口上建立並操作,就象WINDOWS裡面的資源管理器的左邊的目錄樹那個控件。
MFC provides two classes that encapsulate tree controls:CTreeCtrl andCTreeView. Each class is useful in different situations.
Use CTreeCtrl when you need a plain child window control;
for instance, in a dialog box. You'd especially want to use CTreeCtrl if there will be other child controls in the window, as in a typical dialog box.
Use CTreeView when you want the tree control to act like a view window indo
cument/view architecture as well as a tree control. A CTreeView will occupy the entire client area of a frame window or splitter window. It will be automatically resized when its parent window is resized, and it can process command messages from menus, accelerator keys, and toolbars. Since a tree control contains the data necessary to display the tree, the correspondingdo
cument objectdo
es not have to be complicated you could even useCDocument as thedo
cument type in yourdo
cument template.
 
还是不明白
我要做出部门层次结构,且要显示部门下的员工。我希望我的程序左面一个树,用来显示部门,,右面一个表格用来显示选中部门下的员工!
那树我用CTreeCtrl?CTreeView?还是用ActiveX的TreeView?
 
CTreeView、CTreeCtrl都可以,CTreeView是幫你做好這樣的樣式,但是你可以自己重做的。CTreeView就是你說的那個樣式了
 
我建議你用DELPHI,VC++這些東西還沒有搞懂,我看,要很多時間給你熟悉。VC++的可視化不是很好的。
 
簡單點說:
CTreeCtrl是個按件
CTreeView是個視圖
CTreeView是View裡包含一個CTreeCtrl用GetTreeCtrl()取得.
 
后退
顶部