title: ListView - How to respond to double click on non-item?
body: <p>What I want the ability to do is to double click on an empty row in a ListView and have it insert an item there. It already responds to the MouseDoubleClick event (for editing items) and that is working fine, but it appears that the MouseDoubleClick doesn't get fired if the double click is on a part of the ListView that doesn't contain a ListViewItem.</p>
  
  <p>I've already tried responding to regular MouseDoubleClick events on the dialog itself, but the event doesn't get fired if it's on one of the "null areas" of the ListView.</p>
  
  <p>Is there a way to do respond to a click on the "null areas" of a ListView without subclassing? What event/events needs/need to be handled in order to do this?</p>
  
  <p>The current response to dialog double clicks (mouse and regular) looks like this:</p>
  
  <pre><code>if ( RectangleToScreen(list.ClientRectangle).Contains(e.X, e.Y) )
     list_MouseDoubleClick(sender, e);
  </code></pre>
  
  <p>and the list_MouseDoubleClick() (where m_SelItem is the currently selected item)</p>
  
  <pre><code>private void list_MouseDoubleClick(object sender, MouseEventArgs e)
  {
     if ( m_SelItem == null &amp;&amp; m_Combo.Items.Count &gt; 0 )
     {
      m_SelItem = new ListViewItem(new string[] { "", "Rd" });
      list.Items.Add(m_SelItem);
     }
  ...
  }
  </code></pre>
  
  <p>EDIT: It seems that that whole region is just a black hole for events. For instance, I tried to respond to just a regular click/mouseclick event for both the ListView and the Dialog. Even those don't get triggered unless the click is on a ListViewItem. I'm guessing the only solution is going to be to subclass.</p>
  
  <p>EDIT: Persistence pays off! It turns out that I can get the desired result by responding to the "MouseDown" event as such:</p>
  
  <pre><code>private void list_MouseDown(object sender, MouseEventArgs e)
  {
      if ( e.Clicks == 2 )
          list_MouseDoubleClick(sender, e);
  }
  </code></pre>