xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation";
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
Title="Window1" Height="300" Width="300">
Imports System.Windows.Media.Animation
Class Window1
Private LL As New Windows.Controls.Label
Private Sub Window1_Loaded(ByVal sender As Object, ByVal
e As System.Windows.RoutedEventArgs) Handles Me.Loaded
LL.Content = "dgkdjsjfklògjsòldfg"
LL.Name = "Label1"
LL.HorizontalAlignment Windows.HorizontalAlignment.Left
LL.VerticalAlignment Windows.VerticalAlignment.Top
LL.Foreground = Brushes.Black
LL.Visibility = Windows.Visibility.Visible
Me.Grid1.Children.Add(LL)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.Windows.RoutedEventArgs) Handles
Button1.Click
Dim sb As New Storyboard
Dim myDoubleAnimation As New DoubleAnimation
myDoubleAnimation.From = 0
myDoubleAnimation.To = 100
myDoubleAnimation.Duration TimeSpan.FromMilliseconds(2000)
Storyboard.SetTargetName(myDoubleAnimation,
"Label1")
Dim PropP As New PropertyPath(Canvas.LeftProperty)
Storyboard.SetTargetProperty(myDoubleAnimation,
PropP)
Dim myDoubleAnimation2 As New DoubleAnimation
myDoubleAnimation2.From = 0
myDoubleAnimation2.To = 100
myDoubleAnimation2.Duration TimeSpan.FromMilliseconds(2000)
Storyboard.SetTargetName(myDoubleAnimation2,
"Label1")
Dim PropP2 As New PropertyPath(Canvas.TopProperty)
Storyboard.SetTargetProperty(myDoubleAnimation2,
PropP2)
sb.Children.Add(myDoubleAnimation)
sb.Children.Add(myDoubleAnimation2)
Me.BeginStoryboard(sb)
End Sub
End Class
Why not function?
please!
Loading
Martin CookPosted Feb 10, 2010, 8:41 AM
You're welcome. Here's the first part of a series on Expression Blend, a tool for designing the presentation like this: -
http://channel9.msdn.com/posts/Nichop/Real-world-WPF-Introduction-to-Blend-Part1/
Cheers,
Martin
Mirco SolatoPosted Feb 10, 2010, 8:24 AM
thank you!
Martin CookPosted Feb 10, 2010, 7:51 AM
Presentation Stuff like this should be done purely in XAML.
Here's something I just whipped up for you: -
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
Cheers,
Martin