Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: MouseClick Event On a Datagrid

$
0
0

The following works for me and takes the appropriate path depending on which component of the grid is clicked. If you set a breakpoint on the if statement and hover the mouse over ls-cHitTestInfo then you can see the Type that it is testing against.

      method-id dataGridView1_MouseClick final private.
      01 ls-cHitTestInfo type "System.Windows.Forms.DataGridView+HitTestInfo".
      01 ls-x binary-long.
      01 ls-y binary-long.
      procedure division using by value sender as object e as type System.Windows.Forms.MouseEventArgs.

         set ls-cHitTestInfo to self::dataGridView1::HitTest(e::X, e::Y)
         if ls-cHitTestInfo::Type = type DataGridViewHitTestType::RowHeader
            set dataGridView1::EditMode to type DataGridViewEditMode::EditOnKeystrokeOrF2
            invoke self::dataGridView1::EndEdit
         else
            set self::dataGridView1::EditMode to type DataGridViewEditMode::EditOnEnter
         end-if

      end method.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>