using System;
using System.Drawing ;
using System.Windows .Forms ;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1( )
{
InitializeComponent( ) ;
}
private void Form1_Shown( object sender, EventArgs e)
{
contextMenuStrip1.KeyDown += new KeyEventHandler( contextMenuStrip1_KeyDown) ;
contextMenuStrip1.Closed += new ToolStripDropDownClosedEventHandler( contextMenuStrip1_Closed) ;
ContextMenuStrip cms = new ContextMenuStrip( ) ;
ToolStripItem item1 = new ToolStripMenuItem( ) ;
item1.Text = "テスト1" ;
cms.Items .Add ( item1) ;
contextMenuStrip1 = cms;
contextMenuStrip1.Show ( new Point( 0 , 0 ) ) ;
}
void contextMenuStrip1_Closed( object sender, ToolStripDropDownClosedEventArgs e)
{
MessageBox.Show ( "メニューが閉じられました" ) ;
}
void contextMenuStrip1_KeyDown( object sender, KeyEventArgs e)
{
MessageBox.Show ( "キーが押されました" ) ;
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uRHJhd2luZzsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIHZvaWQgRm9ybTFfU2hvd24ob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBjb250ZXh0TWVudVN0cmlwMS5LZXlEb3duICs9IG5ldyBLZXlFdmVudEhhbmRsZXIoY29udGV4dE1lbnVTdHJpcDFfS2V5RG93bik7CiAgICAgICAgICAgIGNvbnRleHRNZW51U3RyaXAxLkNsb3NlZCArPSBuZXcgVG9vbFN0cmlwRHJvcERvd25DbG9zZWRFdmVudEhhbmRsZXIoY29udGV4dE1lbnVTdHJpcDFfQ2xvc2VkKTsKCiAgICAgICAgICAgIENvbnRleHRNZW51U3RyaXAgY21zID0gbmV3IENvbnRleHRNZW51U3RyaXAoKTsKCiAgICAgICAgICAgIFRvb2xTdHJpcEl0ZW0gaXRlbTEgPSBuZXcgVG9vbFN0cmlwTWVudUl0ZW0oKTsKICAgICAgICAgICAgaXRlbTEuVGV4dCA9ICLjg4bjgrnjg4gxIjsKICAgICAgICAgICAgY21zLkl0ZW1zLkFkZChpdGVtMSk7CiAgICAgICAgICAgIGNvbnRleHRNZW51U3RyaXAxID0gY21zOwogICAgICAgICAgICBjb250ZXh0TWVudVN0cmlwMS5TaG93KG5ldyBQb2ludCgwLCAwKSk7CiAgICAgICAgfQoKICAgICAgICB2b2lkIGNvbnRleHRNZW51U3RyaXAxX0Nsb3NlZChvYmplY3Qgc2VuZGVyLCBUb29sU3RyaXBEcm9wRG93bkNsb3NlZEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgTWVzc2FnZUJveC5TaG93KCLjg6Hjg4vjg6Xjg7zjgYzplonjgZjjgonjgozjgb7jgZfjgZ8iKTsKICAgICAgICB9CgogICAgICAgIHZvaWQgY29udGV4dE1lbnVTdHJpcDFfS2V5RG93bihvYmplY3Qgc2VuZGVyLCBLZXlFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIE1lc3NhZ2VCb3guU2hvdygi44Kt44O844GM5oq844GV44KM44G+44GX44GfIik7CiAgICAgICAgfQoKICAgIH0KfQo=
compilation info
prog.cs(2,14): error CS0234: The type or namespace name `Drawing' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(3,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 2 error(s), 0 warnings
stdout