How to handle key press events in VSLS using Vb. net RRS feed

  • Question

  • Hi,

    The image below shows the output of my simple program which display all pending compliances from our headquarters.  The system simply continuously loop infinitely and displays all the records in the collection until a key is press by a user.  I used FOR...EACH statement to read the records in the collection and a DO...UNTIL statement to repeat the process of reading and displaying the records.  Unfortunately, I cannot figure out how to handle the key press event inside my program.  Below also is the sample code I have use...

    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



    Wednesday, June 27, 2018 3:54 AM

All replies

  • Suscribe to the KeyDown event of the control.

    ex: textbox.KeyDown+=textbox_KeyDown; (c#)

    Friday, January 18, 2019 8:30 PM