Click here to Skip to main content
15,908,776 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralNeed help with listbox! Pin
Member 210748512-Jul-05 16:38
Member 210748512-Jul-05 16:38 
GeneralRe: Need help with listbox! Pin
seee sharp12-Jul-05 17:00
seee sharp12-Jul-05 17:00 
GeneralStrange web-service behavior with a c# client Pin
malharone12-Jul-05 13:10
malharone12-Jul-05 13:10 
GeneralRe: Strange web-service behavior with a c# client Pin
Amju13-Jul-05 2:54
Amju13-Jul-05 2:54 
GeneralRe: Strange web-service behavior with a c# client Pin
malharone13-Jul-05 5:46
malharone13-Jul-05 5:46 
GeneralOutlook PST Data Report Pin
Anonymous12-Jul-05 11:28
Anonymous12-Jul-05 11:28 
GeneralSendInput API Method Pin
DigitalBay12-Jul-05 10:23
DigitalBay12-Jul-05 10:23 
GeneralRe: SendInput API Method Pin
progload12-Jul-05 13:06
progload12-Jul-05 13:06 
May be this will help you out, it sets the num lock,scroll lock and cap lock keys, but it should work with any key added to VirtualKeys.

'------------ Form1.vb ----------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Check and set the Keyboard NUMLOCK
Dim ret As Boolean = Keyboard.GetState(VirtualKeys.VK_NUMLOCK)
' if it's on, turn it off, if it's off, turn it on
If ret = True Then
Keyboard.SetState(VirtualKeys.VK_NUMLOCK, False)
Else
Keyboard.SetState(VirtualKeys.VK_NUMLOCK, True)
End If
End Sub


'------------ Class1.vb ----------------------------------------------

Imports System
Imports System.Runtime.InteropServices

Public Enum VirtualKeys
VK_NUMLOCK = &H90
VK_SCROLL = &H91
VK_CAPITAL = &H14
End Enum

Class Keyboard

Const KEYEVENTF_EXTENDEDKEY As Int32 = 1
Const KEYEVENTF_KEYUP As Int32 = 2

<DllImport("user32.dll")> _
Shared Function GetKeyState(ByVal nVirtKey As Integer) As Short
End Function

<DllImport("user32.dll")> _
Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32)
End Sub

Public Shared Function GetState(ByVal Key As VirtualKeys) As Boolean
Return (GetKeyState(CType(Key, Integer)) = 1)
End Function

Public Shared Sub SetState(ByVal Key As VirtualKeys, ByVal State As Boolean)
If Not (State = GetState(Key)) Then
keybd_event(CType(Key, Byte), 69, KEYEVENTF_EXTENDEDKEY Or 0, 0)
keybd_event(CType(Key, Byte), 69, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If
End Sub
End Class

Generalactivex selft rejistrationvb Pin
_tasleem12-Jul-05 8:39
_tasleem12-Jul-05 8:39 
GeneralUpdating/Writing to SQL Server Pin
spettiford12-Jul-05 8:17
spettiford12-Jul-05 8:17 
GeneralRe: Updating/Writing to SQL Server Pin
ToddHileHoffer12-Jul-05 10:01
ToddHileHoffer12-Jul-05 10:01 
GeneralData List Pin
erikkl200012-Jul-05 7:56
erikkl200012-Jul-05 7:56 
GeneralRe: Data List Pin
ToddHileHoffer12-Jul-05 10:03
ToddHileHoffer12-Jul-05 10:03 
GeneralRe: Data List Pin
erikkl200012-Jul-05 12:21
erikkl200012-Jul-05 12:21 
GeneralCheckboxes Pin
Victoria3412-Jul-05 7:00
Victoria3412-Jul-05 7:00 
GeneralRe: Checkboxes Pin
Anonymous12-Jul-05 9:56
Anonymous12-Jul-05 9:56 
QuestionHow can load the data in CrystalReport Pin
Jeeva Jose12-Jul-05 5:15
Jeeva Jose12-Jul-05 5:15 
AnswerRe: How can load the data in CrystalReport Pin
ToddHileHoffer12-Jul-05 6:50
ToddHileHoffer12-Jul-05 6:50 
GeneralHELP!!! SQL Pin
Member 202519312-Jul-05 3:58
Member 202519312-Jul-05 3:58 
GeneralRe: HELP!!! SQL Pin
d.olsson12-Jul-05 4:12
d.olsson12-Jul-05 4:12 
GeneralRe: HELP!!! SQL Pin
toxcct12-Jul-05 6:17
toxcct12-Jul-05 6:17 
GeneralRe: HELP!!! SQL Pin
toxcct12-Jul-05 6:19
toxcct12-Jul-05 6:19 
GeneralRe: HELP!!! SQL Pin
Ray Guan12-Jul-05 20:15
Ray Guan12-Jul-05 20:15 
GeneralHELP!!!!! working with data grids Pin
Member 202519312-Jul-05 3:53
Member 202519312-Jul-05 3:53 
GeneralRe: HELP!!!!! working with data grids Pin
d.olsson12-Jul-05 4:14
d.olsson12-Jul-05 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.