Hi friends this is my first blogging site, dedicated to all my friends who interested in programming.
At first we can use the visual studio then select the windows application. We can drag the picture box from tool menu and choose the image from local resources.
Now choose one more picture box from tool menu and choose another image from local resources for moving around the picturebox1 and we can drag one timer from tool.
Now come for coding path we use the c# language for this application.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace movingimage
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
pictureBox2.SetBounds(438, 104, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(303, 79, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(162, 105, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(132, 194, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(155, 284, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(294, 320, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(426, 291, 100, 61);
Thread.Sleep(100);
pictureBox2.SetBounds(457, 200, 100, 61);
Thread.Sleep(100);
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.SetBounds(225, 140, 237, 174);
timer1.Start();
}
private void Form1_MouseDoubleClick(object sender, MouseEventArgs e)
{
timer1.Stop();
}
}
}
//the output comes like football move around the earth.
//the output comes like football move around the earth.
//I hope both of you understood.
//Thank you !
0 comments:
Post a Comment