Ejemplo n.º 1
0
        private void dataGridViewSizeRun_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                if (e.RowIndex >= 0)
                {
                    //若行已是选中状态就不再进行设置
                    if (StyleCodeInfodataGridView.Rows[e.RowIndex].Selected == false)
                    {
                        StyleCodeInfodataGridView.ClearSelection();
                        StyleCodeInfodataGridView.Rows[e.RowIndex].Selected = true;
                    }
                    ////只选中一行时设置活动单元格
                    //if (StyleCodeInfodataGridView.SelectedRows.Count == 1)
                    //{
                    //    StyleCodeInfodataGridView.CurrentCell = StyleCodeInfodataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];
                    //}
                    //弹出操作菜单

                    mePrintSizeLable.Show(MousePosition.X, MousePosition.Y);
                    // MessageBox.Show("点右键了");
                }
            }
        }
Ejemplo n.º 2
0
 private void meCopyRows_Click(object sender, EventArgs e)
 {
     Clipboard.SetDataObject(StyleCodeInfodataGridView.GetClipboardContent());
 }