G
Guest
Hi
I am running a code in which on a button press event i programmatically
dropdown combobox by passing it F4 key the same code is running perfect in c#
but in vb.net i m getting exception "NotSupportedException"
---vb.net code is---
<DllImport("coredll.dll")> _
Public Function keybd_event( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Integer, _
ByVal dwExtraInfo As Integer)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
ComboBox1.Focus()
keybd_event(CByte(Keys.F4), 0, 0, 0)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
---c# code is---
[DllImport("coredll.dll")]
public static extern void keybd_event(byte bVk, byte
bScan, int dwFlags, int dwExtraInfo);
private void button1_Click(object sender, System.EventArgs e)
{
ComboBox1.Focus();
keybd_event((byte)Keys.F4, 0, 0, 0);
}
any idea?
I am running a code in which on a button press event i programmatically
dropdown combobox by passing it F4 key the same code is running perfect in c#
but in vb.net i m getting exception "NotSupportedException"
---vb.net code is---
<DllImport("coredll.dll")> _
Public Function keybd_event( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Integer, _
ByVal dwExtraInfo As Integer)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
ComboBox1.Focus()
keybd_event(CByte(Keys.F4), 0, 0, 0)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
---c# code is---
[DllImport("coredll.dll")]
public static extern void keybd_event(byte bVk, byte
bScan, int dwFlags, int dwExtraInfo);
private void button1_Click(object sender, System.EventArgs e)
{
ComboBox1.Focus();
keybd_event((byte)Keys.F4, 0, 0, 0);
}
any idea?