DoubleAnimation中的'Completed'方法在哪里(WPF,VB.NET) [英] Where is the 'Completed' Method in DoubleAnimation (WPF, VB.NET)
本文介绍了DoubleAnimation中的'Completed'方法在哪里(WPF,VB.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的WPF应用程序中,我遇到了一个很大的动画问题。我用代码实现淡出动画,但代码不理解'Completed'方法。 CSharp可以这样做。
In my WPF App, I got a big problem for animation. I realizing fade out animation with code, but the code didn't understand the 'Completed' Method. CSharp can do with like this.
anim.Completed += (s, _) => this.Close();
但VB.NET无法得到它。
你能帮我写下答案吗? : - )
But the VB.NET can't got it.
Can you help me for write the answer please? :-)
推荐答案
使用AddHandler
在VB.NET中添加事件处理程序;
UseAddHandler
to add event handlers in VB.NET;
Dim anim As DoubleAnimation = New DoubleAnimation
Private Sub MySub()
Dim anim As DoubleAnimation = New DoubleAnimation
AddHandler anim.Completed, Sub(s, e) Me.Close()
' Or
AddHandler anim.Completed, AddressOf MyEventHandlingFunction
End Sub
Private Sub MyEventHandlingFunction()
Me.Close()
End Sub
希望这会有所帮助,
Fredrik
Hope this helps,
Fredrik
这篇关于DoubleAnimation中的'Completed'方法在哪里(WPF,VB.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文