以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]ListView问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=65213)

--  作者:pcxjxjhkw
--  发布时间:2015/3/11 15:47:00
--  [求助]ListView问题
1.ListView为什么没有CurrentChanged事件?
2.ListView用图片已生成了图标,如何只用另一图片替换当前行图标?


谢谢

--  作者:有点甜
--  发布时间:2015/3/11 15:49:00
--  

 1、http://www.foxtable.com/help/topics/2786.htm

 


--  作者:有点甜
--  发布时间:2015/3/11 15:50:00
--  

2、怎样生成,就怎样替换

 

http://www.foxtable.com/help/topics/2857.htm

 


--  作者:Bin
--  发布时间:2015/3/11 15:50:00
--  
1有RowSelectionChanged


--  作者:pcxjxjhkw
--  发布时间:2015/3/11 15:59:00
--  
2.执行MessageBox.Show(e.Index),结果显示选择前的行和选择后的行两个Index。只需要选择后的行的Index


--  作者:有点甜
--  发布时间:2015/3/11 16:01:00
--  
测试没有问题啊,按照楼上的写代码,一点问题都没有啊。
--  作者:pcxjxjhkw
--  发布时间:2015/3/11 16:05:00
--  
问题2:代码如下,麻烦大家修定一下。
Dim pic As WinForm.PictureBox = e.Form.Controls("图片预览框")
Dim lvw As WinForm.ListView = e.Form.Controls("图片略缩图")
Dim bmp As New bitmap(pic.ImageFile)
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
bmp.save(pic.ImageFile)
Dim h As Integer = pic.Height
Dim w As Integer = pic.Width
pic.Height = w
pic.Width = h
pic.Image = bmp
Dim zp As String = pic.ImageFile
Dim Key As String = zp
\'lvw.Images.LargeSize = New Size(60,80) \'定义大图标尺寸
\'lvw.Images.SmallSize = New Size(15,20) \'定义小图标尺寸
lvw.Images.AddImage(Key,Key,key)
Dim vr As  WinForm.ListViewRow = lvw.Current.
vr.ImageKey = key

--  作者:pcxjxjhkw
--  发布时间:2015/3/11 16:09:00
--  
问题1:假如共生成了5个图标,在其RowSelectionChanged事件中用MessageBox.Show(e.Index)测试,当单击第一个图标,再单击第三个图标,结果为:0,2


--  作者:有点甜
--  发布时间:2015/3/11 16:10:00
--  
上传例子说明问题。
--  作者:有点甜
--  发布时间:2015/3/11 16:11:00
--  
直接说你想做什么,不要一步步不知道你想做什么