Beispiel #1
0
        private void FriendData_MouseUp(object sender, MouseEventArgs e)
        {
            DataGridView.HitTestInfo hitTestInfo;

            if (e.Button == MouseButtons.Right)
            {
                hitTestInfo = FriendData.HitTest(e.X, e.Y);

                int col = hitTestInfo.ColumnIndex;
                int row = hitTestInfo.RowIndex;

                if (col < 0)
                {
                    col = 0;
                }
                if (row < 0)
                {
                    row = 0;
                }

                this.FriendData.CurrentCell = this.FriendData[col, row];

                ContextMenuStrip menu = new ContextMenuStrip();

                menu.Items.Add("수    정");
                menu.Items.Add("삭    제");

                menu.ItemClicked += new ToolStripItemClickedEventHandler(FriendMenu_ItemClicked);

                menu.Show(FriendData, new Point(e.X, e.Y));
            }
        }