First of All i would Thank this forum. Most of my programming queries were solved here. I dint had to write any new thread..
I am new to windows Application programing. but i am some how managing ..
But now i need a start to do something like This.

If any one has ideas or have done it before please help me out..
Thank You your time.

Recommended Answers

All 7 Replies

I would start a forms application and put a splitcontainercontrol in it.
In Panel1 I would put a TreeView control in Panel2 I would try a ListView.

commented: Perfectly answered :D +6

Thank You ddanbe..
Now :
1)
how to make all the child node checked when parent node is checked. i tried this but only first 2 child nodes get checked.. here's what i tried.

private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
        {                 
            //MessageBox.Show(e.Node.Level.ToString());
            
            //MessageBox.Show(e.Node.Nodes.Count.ToString());
            if (e.Node.Checked)
            {
                int n = e.Node.Level;
                TreeNode a = new TreeNode();
                a = e.Node;
                MessageBox.Show(a.Index.ToString());
                if (a.Nodes.Count != 0)
                    a.FirstNode.Checked = true;
                else
                {
                    if (a.Index <= a.Nodes.Count)
                    {
                        a = a.NextNode;
                        if (a != null)
                            a.Checked = true;
                    }
                    else
                    {
                        a = a.Parent.NextNode;
                        if (a != null)
                            a.Checked = true;
                    }

                }

            }
        }

Am I totally wrong here?

2) how to bring the system directory's in tree view.

Thank You Very Much Antenka.. I dint realize it was so easy LoL..
Thank You ddanbe & Antenka Again for Your Time..

Okay..
how do i make the control pannel , Recycle Bin ,Cd drive's not listed in the treeview..
any idea..

Hello, jobi116.
As one of the solutions, I can offer this to you:
there is one function : SHGetFolderPath (shell32), that can help you get the path to 'special' folders, like you are listed. Here you can find much more such folders.
Also there is some class in .Net, that allows you to get path to some of that folders: Environment.SpecialFolder Enumeration.

So all you have to do - catch the 'special' folder and do not add it into your treeview.

P.S. I had some troubles getting the path to the Control Panel, so if you'll get something like that - we'll invent something else ;) Good luck.

P.P.S. If you want to investigate more in using shell, look here:
C# does Shell, Part 1
C# does Shell, Part 2
C# does Shell, Part 3
C# does Shell, Part 4

Thank You Again Ankenta..
I did go through the links..
and i added ShellAPI.SHGFI.SHGFI_TYPENAME for vflags..

ShellAPI.SHFILEINFO shInfo = new ShellAPI.SHFILEINFO();
            ShellAPI.SHGFI vFlags =
                ShellAPI.SHGFI.SHGFI_SMALLICON |
                ShellAPI.SHGFI.SHGFI_SYSICONINDEX |
                ShellAPI.SHGFI.SHGFI_PIDL |
                ShellAPI.SHGFI.SHGFI_DISPLAYNAME |
                ShellAPI.SHGFI.SHGFI_TYPENAME ;

            ShellAPI.SHGetFileInfo(m_pIDL, 0, out shInfo,             (uint)Marshal.SizeOf(shInfo), vFlags);

Now i can get the type of the Shellitem ..
That is Control Pannel, My Documents are of type System Folder.
and Cd Drives are of Type CD Drives, And HD Partition were of Type Local Disk..
Since i wanted My Computer node to List only HD Partition i added an condition before creating node.

foreach (ShellItem shChild in arrSub)
{
if (((ShellItem) e.Node.Tag).ShType == "System Folder" && shChild.ShType.ToString() != "Local Disk")
                    continue;

This solves my problem but i don't know if this is the better way.. and does it have any bug..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.