// リストビューダブルクリック時 // テキストボックスを表示し項目を編集できるようにする private void listViewProcess_DoubleClick(object sender, System.EventArgs e) { System.Drawing.Point p = System.Drawing.Point.Empty; p.X = System.Windows.Forms.Cursor.Position.X; p.Y = System.Windows.Forms.Cursor.Position.Y; System.Drawing.Point cp = this.listViewProcess.PointToClient(p); System.Windows.Forms.ListViewItem item = this.listViewProcess.GetItemAt(cp.X, cp.Y); System.Drawing.Point lvsp = this.listViewProcess.HitTest(cp); // 範囲外(行/列インデックス値取得失敗)の場合は即時終わり if (item.Index == -1 || cp.X == -1) { return; } // マウスの位置に編集用テキストボックスを表示 Utility.CustomControl.ListViewTextBox InputBox = new Utility.CustomControl.ListViewTextBox(this.listViewProcess, item, lvsp.X); InputBox.FinishInput += new Utility.CustomControl.ListViewTextBox.InputEventHandler(inputBox_FinishInput); InputBox.Show(); }
// ���X�g�r���[�_�u���N���b�N�� // �e�L�X�g�{�b�N�X��\�������ڂ�ҏW�ł���悤�ɂ��� private void listViewProcess_DoubleClick(object sender, System.EventArgs e) { System.Drawing.Point p = System.Drawing.Point.Empty; p.X = System.Windows.Forms.Cursor.Position.X; p.Y = System.Windows.Forms.Cursor.Position.Y; System.Drawing.Point cp = this.listViewProcess.PointToClient( p ); System.Windows.Forms.ListViewItem item = this.listViewProcess.GetItemAt( cp.X, cp.Y ); System.Drawing.Point lvsp = this.listViewProcess.HitTest( cp ); // �͈͊O(�s/��C���f�b�N�X�l�擾���s)�̏ꍇ�͑����I��� if ( item.Index == -1 || cp.X == -1 ) { return; } // �}�E�X�̈ʒu�ɕҏW�p�e�L�X�g�{�b�N�X��\�� Utility.CustomControl.ListViewTextBox InputBox = new Utility.CustomControl.ListViewTextBox( this.listViewProcess, item, lvsp.X ); InputBox.FinishInput += new Utility.CustomControl.ListViewTextBox.InputEventHandler( inputBox_FinishInput ); InputBox.Show(); }