Change mouse speed from setting the value in a textbox (textbox1), then clicking a button to change it (set it).
Printable View
Change mouse speed from setting the value in a textbox (textbox1), then clicking a button to change it (set it).
Add this to the form:
and put this in the button's Click sub:Code:Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Integer, ByVal uParam As Integer, ByRef lpvParam As Object, ByVal fuWinIni As Integer) As Integer
Const SPI_SETMOUSESPEED As Integer = 113
The maximum value for the speed is 20.Code:SystemParametersInfo(SPI_SETMOUSESPEED, 0, Integer.Parse(TextBox1.Text), 0)
cheers, BB
I'd be very careful about changing system-wide settings like the mouse speed unless your program is specifically designed to do that.
Nothing a user hates more than a program that messes around with their windows settings if they don't realise thats whats happening.
Point taken. Thanks, Paul. BB