本文整理匯總了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