| | |
Using COM TreeView in C# Windows Forms
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
TreeView was one of my favourite control in COM. It is well suited for creating Chart of Accounts, Hierarchical data and the like. Though there is a tree view in .Net I find it less flexible in comparison to COM TreeView.
The issue with using COM TreeView in C# is C# does not support optional parameters. Type.Missing it the way out.
The issue with using COM TreeView in C# is C# does not support optional parameters. Type.Missing it the way out.
using MSComctlLib; Node NodX; private void Form1_Load(object sender, EventArgs e) { Object m = Type.Missing; Object i = "India"; NodX = axTreeView1.Nodes.Add(ref m, ref m, ref i, ref i, ref m, ref m); Object k = "Kerala"; Object rel = TreeRelationshipConstants.tvwChild; NodX = axTreeView1.Nodes.Add(ref i, ref rel, ref k, ref k, ref m, ref m); Object ka = "Karnataka"; NodX = axTreeView1.Nodes.Add(ref i, ref rel, ref ka, ref ka, ref m, ref m); Object ko = "Kochi"; NodX = axTreeView1.Nodes.Add(ref k, ref rel, ref ko, ref ko, ref m, ref m); NodX.EnsureVisible(); }
Similar Threads
- Drag and drop from windows forms to desktop and windows explorer (C#)
- Windows forms (C#)
- Windows forms (C#)
- TreeView in windows Application (C#)
- Using Windows XP Visual Styles with Controls on Windows Forms (VB.NET)
| Thread Tools | Search this Thread |
.net access algorithm angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform post programming radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio webbrowser winforms wpf wpfc# xml



