怎么将ListView中绑定ImageList的图片点击后显示到RichTexrBox中。

解决方案 »

  1.   

    通过ImageListIndex来获得ImageList中Image对象,至于如何往RichTextBox中放入图片
    参看
    http://www.codeproject.com/cs/miscctrl/csexrichtextbox.asp
      

  2.   

    把图片拷进 My.Computer.Clipboard ,然后粘贴到RichTextBox
      

  3.   

    My.Computer.Clipboard.SetImage([你ImageList里的图片])
    然后RichTextBox.Past()
      

  4.   

    感谢两位的帮助。to Knight94(愚翁)
    我已经实现了向richtextbox中插入图片了,但是我现在不明白的就是怎么取到listview中选择的图片。
    ImageListIndex是什么?
      

  5.   

    Sample code as follows:
    Image imgItem = yourImageList[yourItem.ImageIndex];
      

  6.   

    呵呵
    还是不明白,跟listview怎么关联上阿?
      

  7.   

    to 还是不明白,跟listview怎么关联上阿?Sample code as follows:
    ListViewItem yourItem = yourListView.Items[i];
    Image imgItem = yourImageList[yourItem.ImageIndex];
      

  8.   

    哈哈  弄出来了,感谢  Knight94(愚翁) 的帮助,给分结贴。
    大家看看吧,我的代码。
    private void listView1_DoubleClick(object sender, EventArgs e)
            {
                Image imgItem = imageList1.Images[listView1.SelectedIndices[0]];
                richTextBox1.InsertImage(new Bitmap(imgItem));
            }