gpt4 book ai didi

c# - ImageList.RemoveAt(index1); 的逆运算是什么?

转载 作者:太空宇宙 更新时间:2023-11-03 19:07:16 25 4
gpt4 key购买 nike

我尝试了很多次来解决这个问题,但我总是得到一个错误,因为它是 ImageList 中的一个图像。我需要什么代码才能从列表中重新添加 删除的图像。这是我的代码(最后一行不起作用)。

int index9 = random.Next(0, normalCards1.Count - 1);
pictureBox9.Image = normalCards1[index9];
normalCards1.RemoveAt(index9);
...
normalCards1.Insert(index9);

最佳答案

您还需要将 T item 与索引一起传递。

你可以这样加回去:

normalCards1.Insert(index9,pictureBox9.Image);

参见 List.Insert Method MSDN docs here

关于c# - ImageList.RemoveAt(index1); 的逆运算是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25185938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com