本文整理汇总了VB.NET中System.Windows.VisualStateManager.GoToElementState方法的典型用法代码示例。如果您正苦于以下问题:VB.NET VisualStateManager.GoToElementState方法的具体用法?VB.NET VisualStateManager.GoToElementState怎么用?VB.NET VisualStateManager.GoToElementState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.VisualStateManager
的用法示例。
在下文中一共展示了VisualStateManager.GoToElementState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: GenerateNumber
Private number As Integer
Private Sub GenerateNumber()
Dim r As New System.Random()
number = r.Next(100) + 1
End Sub
Private Sub OnGuess(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
Dim guess As Integer
If Integer.TryParse(Me.Guess.Text, guess) Then
If guess < Me.number Then
VisualStateManager.GoToElementState(Me.LayoutRoot, "TooLow", True)
Me.Result.Text = "Too Low!"
ElseIf guess > Me.number Then
VisualStateManager.GoToElementState(Me.LayoutRoot, "TooHigh", True)
Me.Result.Text = "Too High!"
Else
VisualStateManager.GoToElementState(Me.LayoutRoot, "Correct", True)
Me.Result.Text = "Correct!"
End If
End If
End Sub
Private Sub OnTypingGuess(ByVal sender As Object, ByVal e As System.Windows.Controls.TextChangedEventArgs)
VisualStateManager.GoToElementState(Me.LayoutRoot, "Guessing", True)
Me.Result.Text = ""
End Sub