تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
انميشن بسطر واحد wpf
#1
كاتب الموضوع : MrBassam

هذا مثال لانميشن بسيط بسطر واحد
ارجو ان يعجبكم
كود الـXAML

كود :
<Window x:Class="LearnWPF.AnimationInCode.Window1"
xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation "
xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml "
Title="LearnWPF.AnimationInCode"
Height="300" Width="300" Loaded="WindowLoaded"
>
<Button Name="myButton" Content="Hello" />
</Window>
كود #c

كود :
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;

namespace LearnWPF.AnimationInCode
{
public partial class Window1 : System.Windows.Window
{
public Window1()
{
InitializeComponent();
}

void WindowLoaded(object sender, RoutedEventArgs e)
{
myButton.BeginAnimation(Button.HeightProperty,
new DoubleAnimation(25, 150, new Duration(new TimeSpan(0, 0, 1))));
}
}
}
كودالمفتاح بال VB

كود :
Imports System.Windows.Media.Animation
Class Window1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
btnOne.BeginAnimation(Button.HeightProperty, New DoubleAnimation(25, 150, New Duration(New TimeSpan(0, 0, 1))))
End Sub
مترجم

بالتوفيق
}}}
تم الشكر بواسطة:


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم