private void SceneryShow_Load(object sender, EventArgs e) { BindTreeView(); if (treeView1.Nodes.Count > 0) { treeView1.Nodes[0].Expand(); } List <Scenery> sceneryList = new List <Scenery>(); sceneryList = SceneryAccess.ShowImag(1); if (sceneryList.Count != 0 && sceneryList != null) { for (int i = 0; i < sceneryList.Count; i++) { Scenery scenery = new Scenery(); scenery = sceneryList[i]; switch (i) { case 0: this.pictureBox1.Image = Image.FromFile(scenery.SYImagSrc, false); label1.Text = scenery.SYName; break; case 1: this.pictureBox2.Image = Image.FromFile(scenery.SYImagSrc, false); label2.Text = scenery.SYName; break; case 2: this.pictureBox3.Image = Image.FromFile(scenery.SYImagSrc, false); label3.Text = scenery.SYName; break; case 3: this.pictureBox4.Image = Image.FromFile(scenery.SYImagSrc, false); label4.Text = scenery.SYName; break; case 4: this.pictureBox5.Image = Image.FromFile(scenery.SYImagSrc, false); label5.Text = scenery.SYName; break; case 5: this.pictureBox6.Image = Image.FromFile(scenery.SYImagSrc, false); label6.Text = scenery.SYName; break; case 6: this.pictureBox7.Image = Image.FromFile(scenery.SYImagSrc, false); label7.Text = scenery.SYName; break; case 7: this.pictureBox8.Image = Image.FromFile(scenery.SYImagSrc, false); label8.Text = scenery.SYName; break; case 8: this.pictureBox9.Image = Image.FromFile(scenery.SYImagSrc, false); label9.Text = scenery.SYName; break; case 9: this.pictureBox10.Image = Image.FromFile(scenery.SYImagSrc, false); label10.Text = scenery.SYName; break; case 10: this.pictureBox11.Image = Image.FromFile(scenery.SYImagSrc, false); label11.Text = scenery.SYName; break; case 11: this.pictureBox12.Image = Image.FromFile(scenery.SYImagSrc, false); label12.Text = scenery.SYName; break; } this.pictureBox1.Image = Image.FromFile(scenery.SYImagSrc, false); } } }
private void ShowImage(int pageNum) { List <Scenery> sceneryList = new List <Scenery>(); sceneryList = SceneryAccess.ShowImag(pageNum); if (sceneryList.Count != 0 && sceneryList != null) { for (int i = 0; i < sceneryList.Count; i++) { Scenery scenery = new Scenery(); scenery = sceneryList[i]; switch (i) { case 0: this.pictureBox1.Image = Image.FromFile(scenery.SYImagSrc, false); label1.Text = scenery.SYName; break; case 1: this.pictureBox2.Image = Image.FromFile(scenery.SYImagSrc, false); label2.Text = scenery.SYName; break; case 2: this.pictureBox3.Image = Image.FromFile(scenery.SYImagSrc, false); label3.Text = scenery.SYName; break; case 3: this.pictureBox4.Image = Image.FromFile(scenery.SYImagSrc, false); label4.Text = scenery.SYName; break; case 4: this.pictureBox5.Image = Image.FromFile(scenery.SYImagSrc, false); label5.Text = scenery.SYName; break; case 5: this.pictureBox6.Image = Image.FromFile(scenery.SYImagSrc, false); label6.Text = scenery.SYName; break; case 6: this.pictureBox7.Image = Image.FromFile(scenery.SYImagSrc, false); label7.Text = scenery.SYName; break; case 7: this.pictureBox8.Image = Image.FromFile(scenery.SYImagSrc, false); label8.Text = scenery.SYName; break; case 8: this.pictureBox9.Image = Image.FromFile(scenery.SYImagSrc, false); label9.Text = scenery.SYName; break; case 9: this.pictureBox10.Image = Image.FromFile(scenery.SYImagSrc, false); label10.Text = scenery.SYName; break; case 10: this.pictureBox11.Image = Image.FromFile(scenery.SYImagSrc, false); label11.Text = scenery.SYName; break; case 11: this.pictureBox12.Image = Image.FromFile(scenery.SYImagSrc, false); label12.Text = scenery.SYName; break; } this.pictureBox1.Image = Image.FromFile(scenery.SYImagSrc, false); } } }