Hi Friends,
i want to move a lable gradually on a form application.
it is something like this,
once i click on the button, a colored lable should move from 1location to another location(locations are predefined:say X1 to X2) smoothly.
smoothly in the sense, it should not jump from one location to another. but it should move gradually/smoothly in a predefined path.
if anyone can please give me a solution..
thanks,
charith
Loading
Kirtan PatelPosted Feb 5, 2010, 3:31 PM
Take One Timer On Form and Code like Below
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1;
}
private void btnMove_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (label1.Location.X <= 100)
{
label1.Location = new Point(label1.Location.X + 2, label1.Location.Y);
}
else
{
timer1.Enabled = false;
}
}
if it help you then check "Do you like this answer "
paul danielPosted Feb 8, 2010, 6:22 AM
http://aspdotnetcodebook.blogspot.com/2009/03/how-to-move-text-box-on-button-click.html