Beispiel #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dgvSearchList.Columns[0].Width = dgvSearchList.Width - 150;

            ToolStripMenuItem tsmi = new ToolStripMenuItem("Play With...");

            ArrayList alMediaPlayers = vdb.GetMediaPlayers();

            foreach (String strMediaPlayer in alMediaPlayers)
            {
                PlayerEventArgs pea = new PlayerEventArgs();
                pea.strPlayer = strMediaPlayer;
                EventHandler eh = new EventHandler(PlayWithEventhandler);
                //eh.Method.
                tsmi.DropDownItems.Add(strMediaPlayer, null, eh);
            }

            DataGridViewCellStyle style = new DataGridViewCellStyle();

            style.Font = new Font(dgvSearchList.Font, FontStyle.Bold);
            dgvSearchList.Columns[1].DefaultCellStyle             = style;
            dgvSearchList.Columns[1].DefaultCellStyle.Alignment   = DataGridViewContentAlignment.MiddleCenter;
            dgvSearchList.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvSearchList.ColumnHeadersDefaultCellStyle           = style;

            cmsMenu.Items.Add(tsmi);
            //btnSearch_Click(sender,e);
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dgvSearchList.Columns[0].Width = dgvSearchList.Width - 150;

            ToolStripMenuItem tsmi = new ToolStripMenuItem("Play With...");

            ArrayList alMediaPlayers = vdb.GetMediaPlayers();

            foreach (String strMediaPlayer in alMediaPlayers)
            {
                tsmi.DropDownItems.Add(strMediaPlayer);
            }

            cmsMenu.Items.Add(tsmi);
            btnSearch_Click(sender, e);
        }