* A simple contextmenu test with a treeview

2008-02-21  Andreia Gaita <avidigal@novell.com>

svn path=/trunk/winforms/; revision=96323
This commit is contained in:
Andreia Gaita 2008-02-21 00:11:19 +00:00
Родитель b395a7458c
Коммит bd8e8575ed
2 изменённых файлов: 41 добавлений и 3 удалений

Просмотреть файл

@ -1,15 +1,18 @@
all: mono
mono: swf-basicmenu.cs swf-popups.cs
mono: swf-basicmenu.cs swf-popups.cs contextmenu.cs
mcs swf-basicmenu.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
mcs swf-popups.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
gmcs contextmenu.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
dotnet: swf-basicmenu.cs swf-popups.cs
dotnet: swf-basicmenu.cs swf-popups.cs contextmenu.cs
csc swf-basicmenu.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
mcs swf-popups.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
csc swf-popups.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
csc contextmenu.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
clean:
rm swf-contextmenu.exe -r -f
rm swf-popups.cs -r -f
rm contextmenu.cs -r -f

Просмотреть файл

@ -0,0 +1,35 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace winforms {
public class form : Form {
public static void Main () {
Application.Run (new form ());
}
public form () {
TreeView tree = new TreeView ();
ContextMenu popupmenu = new ContextMenu ( new MenuItem [] {
new MenuItem ("Menu 1"),
new MenuItem ("Menu 2"),
new MenuItem ("Menu 3")
});
TreeNode t;
t = tree.Nodes.Add ("Node 1");
t.ContextMenu = popupmenu;
t = tree.Nodes.Add ("Node 2");
t.ContextMenu = popupmenu;
t = tree.Nodes.Add ("Node 3");
t.ContextMenu = popupmenu;
tree.Dock = DockStyle.Fill;
this.Controls.Add (tree);
}
}
}