Hi,
Can somebody please help convert this simple program. when I use the converter it says that the Public Declare Function is not supported.
Any help with code translation?
Code:Public Class Form1 Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Integer) As Integer Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If GetAsyncKeyState(17) And e.KeyCode = Keys.X Or GetAsyncKeyState(18) And e.KeyCode = Keys.X Then MsgBox("ALT+X pressed") Me.Close() End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim num1, num2 As Integer num1 = CInt(TextBox1.Text) num2 = CInt(TextBox2.Text) Label2.Text = num1 + num2 End Sub End Class





Reply With Quote