using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Imaging;
public class Program : System.Windows.Forms.Form
{
public Program()
{
Contoh1();
}
private void Contoh1()
{
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
System.Threading.Thread.Sleep(2000);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form2_Paint);
}
static void Main()
{
Application.Run(new Program());
}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
Bitmap bmp = new Bitmap("D:/space.jpg");
g.DrawImage(bmp, 0, 0);
}
private void Form2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
Bitmap bmp = new Bitmap("D:/space 2.jpg");
g.DrawImage(bmp, 0, 0);
}
}
The source code Can't show first picture then after 2 second the source code show second picture. And how to resolve my problem ? I want to understand why the codes in source code doesn't work.