I have scenario where I am displaying the content of a collection one by one until a key is press. The problem is I cannot get the right code to determine when a key is being press. I am designing in Visual Studio Lightswitch using VB.net language. The link below show the output of my program. Sample output of the program. The display keeps on looping until a user presses a key. also below is the sample code I am using.
Private Sub Compliances_Activated()
' Write your code here.
Do until "***the problem is here, I suppose to handle keyevents here but with no luck."***
For Each I In Me.PendingCompliance
If I.Incharge = "S1" Then
Me.Partic = I.Particulars
Me.ActionToUndertake = I.ActionToUndertake
Me.StatusOfCompliance = I.StatusOfCompliance
Dim controlcurr1 = Me.FindControl("Partic1")
AddHandler controlcurr1.ControlAvailable, _
Sub(sender As Object, e As ControlAvailableEventArgs)
Dim textbox = CType(e.Control, System.Windows.Controls.TextBlock)
textbox.Foreground = New SolidColorBrush(Color.FromArgb(200, 0, 126, 230))
textbox.Height = (400.0)
textbox.FontSize = Convert.ToDouble(72.0)
textbox.FontFamily = New FontFamily("arial")
textbox.TextTrimming = TextTrimming.None
End Sub
Dim newsText1 = Me.FindControl("Partic1")
AddHandler newsText1.ControlAvailable, Sub(sender, e)
'Get the istance
Dim block = CType(e.Control, TextBlock)
'Set a different color, if you like
block.Foreground = New SolidColorBrush(Colors.Black)
'Create an animation
Dim sb As New Storyboard
Dim colorAnim As New ColorAnimation
colorAnim.AutoReverse = True
colorAnim.RepeatBehavior = RepeatBehavior.Forever
colorAnim.From = Colors.Blue
colorAnim.To = Colors.White
colorAnim.Duration = TimeSpan.FromSeconds(8)
'Apply the animation
Storyboard.SetTarget(colorAnim, block.Foreground)
Storyboard.SetTargetProperty(colorAnim, New PropertyPath("Color"))
sb.Children.Add(colorAnim)
sb.Begin()
End Sub
End If Next please help
What is the that you are using?
Probably it will be something like this