Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.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
C# 创造无限的图像序列_C#_Winforms_For Loop - Fatal编程技术网

C# 创造无限的图像序列

C# 创造无限的图像序列,c#,winforms,for-loop,C#,Winforms,For Loop,我需要创建一个无限的图像序列,例如: string connectionLine; connectionLine = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";"; MySqlConnection connection = new MySq

我需要创建一个无限的图像序列,例如:

     string connectionLine;
                    connectionLine = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
                    MySqlConnection connection = new MySqlConnection(connectionLine);
                    MySqlCommand command = connection.CreateCommand();
                    command.CommandText = "SELECT comment_content, comment_author FROM " + wp_comments + " WHERE comment_post_ID =@iddo and comment_approved =@app";
                    command.Parameters.AddWithValue("article", article.id);
                    command.Parameters.AddWithValue("app", "1");
                    MySqlDataReader Reader;
                    try
                    {
                        connection.Open();
                        Reader = command.ExecuteReader();
                        if (Reader.HasRows == true)
                        { 
                            while (Reader.Read())
                            {
                                radListControl1.Items.Add("By: " + Reader.GetValue(1) + " - " + Reader.GetValue(0));

                                PictureBox myPicBox = new PictureBox();
                                myPicBox.Location = new Point(300, 200);
                                myPicBox.Width = 328;
                                myPicBox.Height = 131;
                                myPicBox.SizeMode = PictureBoxSizeMode.StretchImage;
                                myPicBox.Visible = true;
                                myPicBox.Image = new Bitmap(Properties.Resources.fumetto);
                                this.Controls.Add(myPicBox);

                                PictureBox myPicBox1 = new PictureBox();
                                myPicBox1.Location = new Point(myPicBox.Location.X, myPicBox.Location.Y + 100);
                                myPicBox1.Width = 328;
                                myPicBox1.Height = 131;
                                myPicBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                                myPicBox1.Visible = true;
                                myPicBox1.Image = new Bitmap(Properties.Resources.fumetto);
                                this.Controls.Add(myPicBox1);
                            }
   }
            }
            catch
            { }
但这种模式适用于2个或3个元素,对于更多元素,无法计算图像的距离

我的想法是:


有可能吗?如何利用图像之间的空间创建无限图像序列?

我想你过一段时间后的表现会成为一个问题。不,我的问题可能是“图像的创建循环”,而不是列表框@你所说的“图像循环”是什么意思?列表框是一个用户控件。
while
循环是一种编程构造。两者都没有关系,而且您的示例输出看起来确实可以实现为一个图像列表框。