تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
Next Button
#3
جرب هذا الكود
كود :
Public Class Form1
    Dim IsSpacePressed As Boolean = False
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GoNext()
    End Sub

    Private Sub Button1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyDown
        If e.KeyCode = 32 Then
            If IsSpacePressed = False Then
                IsSpacePressed = True
            Else
                GoNext()
            End If
        End If
    End Sub
    Private Sub Button1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyUp
        If e.KeyCode = 32 Then
            IsSpacePressed = False
        End If
    End Sub
    Private Sub GoNext()
        If ListBox1.SelectedIndex < ListBox1.Items.Count - 1 Then
            ListBox1.SelectedIndex += 1
        Else
            ListBox1.SelectedIndex = 0
        End If
    End Sub
End Class
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
Next Button - بواسطة relsharkawy - 18-11-12, 10:33 AM
Next Button - بواسطة Sajad - 18-11-12, 11:03 AM
Next Button - بواسطة sooriaty03 - 18-11-12, 01:24 PM
Next Button - بواسطة relsharkawy - 21-11-12, 04:58 AM


التنقل السريع :


يقوم بقرائة الموضوع: