Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication8
- {
- public partial class Form1 : Form
- {
- int count = 2;
- public Form1()
- {
- InitializeComponent();
- }
- private void toolStripMenuItem3_MouseEnter(object sender, EventArgs e)
- {
- ToolStripMenuItem child = new ToolStripMenuItem(""+count);
- ToolStripMenuItem current = sender as ToolStripMenuItem;
- if (current.DropDownItems.Count == 0)
- {
- current.DropDownItems.Add(child);
- current.Name = "curent " + count;
- count++;
- }
- child.MouseEnter += toolStripMenuItem3_MouseEnter;
- current.Click += Child_Click;
- current.Click += Current_Click;
- child.MouseDown += Current_MouseDown;
- }
- private void Current_MouseDown(object sender, MouseEventArgs e)
- {
- if (e.Button==MouseButtons.Right)
- {
- this.toolStripMenuItem3.MergeAction;
- if (sender!=null)
- {
- }
- ToolStripMenuItem curent = sender as ToolStripMenuItem;
- curent.
- curent.Dispose();
- }
- }
- private void Current_Click(object sender, EventArgs e)
- {
- }
- private void Child_Click(object sender, EventArgs e)
- {
- ToolStripMenuItem current = sender as ToolStripMenuItem;
- MessageBox.Show(current.Name);
- }
- //private void toolStripMenuItem3_Click(object sender, EventArgs e)
- //{
- // {
- // MessageBox.Show(toolStripMenuItem1.Name);
- // }
- //}
- private void Form1_MouseClick(object sender, MouseEventArgs e)
- {
- MessageBox.Show(toolStripMenuItem1.Name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement