Re: [問題] 請問picturebox如何寫成for迴圈的形式

看板C_Sharp (C#)作者 (紫雁)時間17年前 (2008/08/13 04:03), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
private void btnGo_Click(object sender, EventArgs e) { int num = int.Parse(txtNum.Text); Bitmap bitmap = new Bitmap(); // 你的圖片在這指定 PictureBox[] pictures = new PictureBox[num]; for (int i = 0; i < num; i++) { pictures[i] = new PictureBox(); pictures[i].Size = bitmap.Size; pictures[i].Location = new Point(bitmap.Size.Width * i, 100); pictures[i].Image = bitmap; this.Controls.Add(pictures[i]); } } 不過這只是個開始 還有些問題需要解決喔 :) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.121.224.251
文章代碼(AID): #18eUoYz2 (C_Sharp)
文章代碼(AID): #18eUoYz2 (C_Sharp)