C#可以编辑的ListView

话不多说,直接上代码,双击可以编辑,编译通过

using System;
using System.Drawing;
using System.Windows.Forms;

namespace ocrDemo
{
    //msg=0x115   (WM_VSCROLL)    

    //msg=0x114   (WM_HSCROLL)  

    ///     

    ///   CListView   的摘要说明。 

    ///     

    public class ListViewEx : ListView

    {

        private TextBox m_tb;

        private ComboBox m_cb;



        public ListViewEx()

        {

            m_tb = new TextBox();

            m_cb = new ComboBox();

            m_tb.Multiline = true;

            m_tb.Visible = false;

            m_cb.Visible = false;

            this.Controls.Add(m_tb);//把当前的textbox加入到当前容器里

            this.Controls.Add(m_cb);

        }

        private void EditItem(ListViewItem.ListViewSubItem subItem)

        {

            if (this.SelectedItems.Count <= 0)

            {

                return;

            }



            Rectangle _rect = su

你可能感兴趣的:(C#)