Exemple #1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;
            if (menuItem != null)
            {
                ContextMenuStrip albumMenu = menuItem.Owner as ContextMenuStrip;

                if (albumMenu != null)
                {
                    Control controlSelected = albumMenu.SourceControl;

                    if (controlSelected is AlbumIcon)
                    {
                        frmAlbumEdit al = new frmAlbumEdit((AlbumIcon)controlSelected, this);
                        al.Show();
                    }
                }
            }
        }