listview中item与label交互使用方法
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace EnhanceListView
{
public partial class EnhanceListView : ListView
{
private TextBox inputBox = new TextBox(); // 输入编辑框
private bool allowEdit = false; // 是否允许编辑
private Point mousePt = new Point(0,0); // 当前鼠标的位置
private int selectIndex = -1; // 当前选中的行
private int subIndex = -1; // 当前选择子项的索引
private int Offset = 4; // 偏移量
private int itemHeight = 13;
private const Int32 WM_VSCROLL = 0x115;
private const Int32 WM_HSCROLL = 0x114;
public EnhanceListView ()
{
InitializeComponent();
this.LabelEdit = false;
inputBox.BorderStyle = BorderStyle.None;
inputBox.Multiline = true;
inputBox.BackColor = Color.LightGray;
inputBox.LostFocus += new EventHandler( inputBox_LostFocus );
}
void inputB