using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace ListViewMultiSelectDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            #if DEBUG
                MinimizeBox = false;
            #else       
                MinimizeBox = true;
            #endif
        }

        [DllImport("coredll")]
        private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

        [DllImport("coredll")]
        private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int
        dwNewLong);

        private const int GWL_STYLE = -16;
        private const int LVS_SINGLESEL = 0x0004;

        private void Form1_Load(object sender, EventArgs e)
        {
            // Устанавливаем многострочное выделение у ListView
            IntPtr hWnd = listView1.Handle;
            int style = GetWindowLong(hWnd, GWL_STYLE);
            SetWindowLong(hWnd, GWL_STYLE, (style & ~LVS_SINGLESEL));
        }

        private void butGetSel_Click(object sender, EventArgs e)
        {
            ListView.SelectedIndexCollection col = this.listView1.SelectedIndices;
            MessageBox.Show(listView1.Items[col[1]].Text);
        }
    }
}