내 창에 Button
이 있는데 어떻게 C#에서 코드를 사용하면 왼쪽으로 시프트하도록 애니메이션을 적용 할 수 있습니까? 그것.System.Windows.Media.Animation을 사용하여 단추 애니메이션 이동
private void myButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
// TODO: Add event handler implementation here.
DoubleAnimation _DoubleAnimation = new DoubleAnimation();
_DoubleAnimation.From = 0;
_DoubleAnimation.To = 100;
_DoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(1));
myButton.BeginAnimation(Button.RenderTransformOriginProperty, _DoubleAnimation);
}
이봐 @Anatoily 내가 OP를 추측 버튼의 폭 재생하지 않고 100 픽셀 왼쪽에 버튼을 이동하려는. 적어도 내가이 질문에서 추론 할 수있는 것. 그래서, 내 대답뿐만 아니라 단추를 이동하려면 게시 된 경우 너비가 필요합니다 귀하의 솔루션을 잘 작동합니다. +1. :) –
@Rohit Vats : 네, 질문을 이해하지 못합니다, 죄송합니다. 당신의 솔루션은 OP에 더 적합합니다. –