title: .Net Compact Framework and MultiSelect ListView
body: <p>So I have a C# .Net Compact Framework 3.5 application with a ListView in it. That ListView should be MultiSelect (select multiple rows at once by dragging over them like in File Explorer).</p>
  
  <p>Because there is no immediate property for that I send a style message to the ListView, with which I unset LVS_SINGLESEL. In my code it looks something like this:</p>
  
  <pre><code>public const int GWL_STYLE = -16;
  public const int LVS_SINGLESEL = 0x0004;
  
  [DllImport("coredll")] 
  public static extern int GetWindowLong(IntPtr hWnd, int nIndex); 
  
  [DllImport("coredll")] 
  public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
  
  public static void EnableLVMultiSelect(System.Windows.Forms.ListView lv)
  {
      int style = GetWindowLong(lv.Handle, GWL_STYLE);
      SetWindowLong(lv.Handle, GWL_STYLE, (style &amp; ~LVS_SINGLESEL)); 
  }
  </code></pre>
  
  <p>What this code does now, is that I can select multiple rows, if I start after the last row. But I cannot select let's say row 2, 3, 4 of 10 rows like I can in the File Explorer.
  I tried it on two different devices with different Windows Mobile Versions (5.0 and 6.5) and they both behaved the same.</p>
  
  <p>Is there something I am missing? Or is this not possible with the .Net Compact Framework?</p>