[Mono-winforms-list] Treeview

Paul paul at all-the-johnsons.co.uk
Tue Aug 2 17:12:54 EDT 2005


Hi,

Does TreeView have the methods Nodes and AfterSelect in it? I'm asking
as I'm playing now with TreeView and it fails to compile complaining
about Nodes and AfterSelect.

Source below.....

TTFN

Paul

using System;
using System.Drawing;
using System.Windows.Forms;

class TreeView : Form
{
  TreeView()
  {
    TreeView tv = new TreeView();
    TreeNode root = new TreeNode("Fish");
    TreeNode cart = new TreeNode("Sharks & Rays");
    TreeNode bony = new TreeNode("Bony fishes");
    tv.Node.Add(root);
    root.Nodes.Add(cart);
    root.Nodes.Add(bony);
    tv.AfterSelect += new TreeViewEventHandler(AfterSelectHandler);
    Controls.Add(tv);
  }

  public void AfterSelectHandler(object src, TreeViewEventArgs ea)
  {
    TreeNode sel = ((TreeView)src).SelectedNode;
    System.Console.WriteLine(sel);
  }

  public static void Main()
  {
    Application.Run(new TreeView());
  }
}


-- 
"Some people will do anything for a woman in uniform" - The Doctor -
Unregenerate (Big Finish audio)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20050802/f680dbbc/attachment.bin


More information about the Mono-winforms-list mailing list