コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DGV_Sessions_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         try
         {
             DataGridView.HitTestInfo hti = DGV_Sessions.HitTest(e.X, e.Y);
             if (hti.RowIndex >= 0)
             {
                 CMS_Sessions.Show(DGV_Sessions, e.Location);
             }
         }
         catch (Exception lEx)
         {
             cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
         }
     }
 }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DGV_Sessions_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                DataGridView.HitTestInfo hti = DGV_Sessions.HitTest(e.X, e.Y);

                if (hti.RowIndex >= 0)
                {
                    DGV_Sessions.ClearSelection();
                    DGV_Sessions.Rows[hti.RowIndex].Selected = true;
                    DGV_Sessions.CurrentCell = DGV_Sessions.Rows[hti.RowIndex].Cells[0];
                }
            }
            catch (Exception lEx)
            {
                cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                DGV_Sessions.ClearSelection();
            }
        }
コード例 #3
0
ファイル: Sessions.cs プロジェクト: xzblueidea/Simsang
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DGV_Session_MouseUp(object sender, MouseEventArgs e)
        {
            DataGridView.HitTestInfo hti;

            if (e.Button == MouseButtons.Right)
            {
                try
                {
                    hti = DGV_Sessions.HitTest(e.X, e.Y);

                    // If cell selection is valid
                    if (hti.ColumnIndex >= 0 && hti.RowIndex >= 0)
                    {
                        DGV_Sessions.CurrentRow.Selected         = false;
                        DGV_Sessions.CurrentCell                 = DGV_Sessions.Rows[hti.RowIndex].Cells[hti.ColumnIndex];
                        DGV_Sessions.Rows[hti.RowIndex].Selected = true;
                        CMS_SessionMgmt.Show(DGV_Sessions, new Point(e.X, e.Y));
                    }
                }
                catch (Exception) { }
            }
        }