This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* A simple contextmenu test with a treeview
2008-02-21 Andreia Gaita <avidigal@novell.com> svn path=/trunk/winforms/; revision=96323
- Loading branch information
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|
||
} | ||
} | ||
} |