Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 无效参数=值';15';对';无效;StateImageIndex';_Vb.net_Indexing_Imagelist - Fatal编程技术网

Vb.net 无效参数=值';15';对';无效;StateImageIndex';

Vb.net 无效参数=值';15';对';无效;StateImageIndex';,vb.net,indexing,imagelist,Vb.net,Indexing,Imagelist,我不理解这个错误,当我将文件添加到我的列表中时,同时会从所选文件中选择一个函数extarct图标,并将extarct图标添加到图像列表中,但当我选择超过15个文件时,会出现此erore消息 “无效参数=值'15'对于'StateMageIndex'无效。” 这是我的密码: Dim ofg As New OpenFileDialog Dim lvp As New ListViewItem ofg.Multiselect = True ofg.Filter = "A

我不理解这个错误,当我将文件添加到我的列表中时,同时会从所选文件中选择一个函数extarct图标,并将extarct图标添加到图像列表中,但当我选择超过15个文件时,会出现此erore消息 “无效参数=值'15'对于'StateMageIndex'无效。”

这是我的密码:

    Dim ofg As New OpenFileDialog
    Dim lvp As New ListViewItem

    ofg.Multiselect = True
    ofg.Filter = "All Files|*.*"

    If ofg.ShowDialog = Windows.Forms.DialogResult.OK Then
        For Each File As String In ofg.FileNames

            Dim hInst As IntPtr = Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly.GetModules()(0))
            Dim iIcon As Int32 = 0
            Dim hIcon As IntPtr

            hIcon = ExtractAssociatedIcon(hInst, File, iIcon)
            ico = Icon.FromHandle(hIcon)
            icondufile = ico.ToBitmap

            Img.Images.Add(icondufile)

            Dim C_File As New IO.FileInfo(File)

            Dim ItemFile As ListViewItem = New ListViewItem(C_File.Name)
            lvp = Files_List.Items.Add(ItemFile)
            lvp.SubItems.Add(MD5Checksum(File))
            lvp.SubItems.Add(hash_generator("sha1", File))
            lvp.SubItems.Add(hash_generator("sha256", File))
            lvp.SubItems.Add(GetCRC32(File))
            lvp.SubItems.Add(hash_generator("sha384", File))
            lvp.SubItems.Add(hash_generator("sha512", File))
            lvp.SubItems.Add(C_File.FullName)
            lvp.SubItems.Add(C_File.Extension)
            Dim Index As Integer

            lvp.StateImageIndex = lvp.Index 'The error comes from here

            ItemFile = Nothing

        Next
根据文件:

尽管在
stateMageList
属性中指定的ImageList可以包含任意数量的图像,并且
stateMageIndex
属性可以设置为等于或小于14的任何值,但只有索引位置0和1处的图像显示为状态图像

那么,您想用
stateMageList
属性做什么呢?为什么要将其设置为大于14的值?

根据文档:

尽管在
stateMageList
属性中指定的ImageList可以包含任意数量的图像,并且
stateMageIndex
属性可以设置为等于或小于14的任何值,但只有索引位置0和1处的图像显示为状态图像


那么,您想用
stateMageList
属性做什么呢?为什么要将其设置为大于14的值?

因为如果我不设置StateImageList索引,则不会显示任何状态图像:(HELP Plz!!您是否有超过14个状态图像?根据文档,只有前两个(索引0和1)用作状态图像。因此,根据要显示的图像,您应该将
stateMageIndex
设置为0或1。图像列表为空,当我将文件添加到列表中时,BMP图像将添加到图像列表的Img.images.add(icondufile)“然后当我添加超过15个文件时,会出现一条错误消息,当我看到我的图像列表中有多少图像时,我发现我喜欢如果我添加20个文件,我在图像列表中找到20个图像,问题是我如何显示超过14个的图像,预览15个文件之后发生的事情……问题解决了,我只是重新放置了它。”ATIMAGEINDEX到IMAGEINDEX因为如果我没有设置StateImageList索引,将不会显示任何状态图像:(帮助Plz!!您有超过14个状态图像吗?根据文档,只有前两个(索引0和1)用作状态图像。因此,根据要显示的图像,您应该将
stateMageIndex
设置为0或1。图像列表为空,当我将文件添加到列表中时,BMP图像将添加到图像列表的Img.images.add(icondufile)“然后当我添加超过15个文件时,会出现一条错误消息,当我看到我的图像列表中有多少图像时,我发现我喜欢如果我添加20个文件,我在图像列表中找到20个图像,问题是我如何显示超过14个的图像,预览15个文件之后发生的事情……问题解决了,我只是重新放置了它。”ATIMAGEINDEX到ImageIndex