Home > Net >  C # to achieve image switching perform broadcast operations but at the same time
C # to achieve image switching perform broadcast operations but at the same time

Time:09-29

Is into the program, click on the picture, picture image changes play at the same time, the compiler can pass the function cannot be achieved, however, is I thinking question just learning c #, to extend the results have a problem, the following code

CodePudding user response:

Bool b=false; Private void pictureBox1_Click (object sender, EventArgs e) {if (b==false) {b=true; This. PictureBox1. Image=Image. FromFile (@ "H: \ \ Kugou \ \ 1. PNG"); Thread th=new Thread (Mplay); Th. IsBackground=true; Th. The Start (); } else {this. PictureBox1. Image=Image. FromFile (@ "H: \ \ Kugou \ \ 3. PNG"); M.C tlcontrols. Pause (); }} private void Form1_Load (object sender, EventArgs e) {pictureBox1. Image=this. PictureBox1. Image=Image. FromFile (@ "H: \ \ Kugou \ \ 1. PNG"); Control. CheckForIllegalCrossThreadCalls=false;
  •  Tags:  
  • C#
  • Related