if (labelXX.Left < this.ClientSize.Width - labelXX.Width + 10 && movement)
{
labelXX.Left++;
if (labelXX.Left == this.ClientSize.Width - labelXX.Width - 10)
{
movement= false;
}
}
if (labelXX.Left > -10 && !movement)
{
labelXX.Left--;
if (labelXX.Left == -10)
{
movement= true;
}
}
private void moveLabel(Label label, double duration, double fromLeft, double fromTop, double fromRight, double fromBottom, double toLeft, double toTop, double toRight, double toBottom)
{
var moveLeft = new ThicknessAnimation(new Thickness(fromLeft, fromTop, fromRight, fromBottom), new Thickness(toLeft, toTop, toRight, toBottom), TimeSpan.FromSeconds(duration));
label.BeginAnimation(BorderThicknessProperty, moveLeft);
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.