|
write your own code using the key_down/key_up events - the below code writes out to the debug window each key has been pressed(down). once you lift up on a key it shows it has been released(up).
Private _KeyDown As New List(Of Int16)
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If Not _KeyDown.Contains(e.KeyCode) Then
_KeyDown.Add(e.KeyCode)
Debug.Print("d:" & Chr(e.KeyValue))
End If
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
If _KeyDown.Contains(e.KeyCode) Then
_KeyDown.Remove(e.KeyCode)
Debug.Print("u:" & Chr(e.KeyValue))
End If
End Sub
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Nice code. I can use this to, but a question: It seem to me that the maximum numbre of simultanious keys is 3. Is this normal?
|
|
|
|
|
Historical.
Ctrl Alt Delete
Ctrl Shift (a Key)
Shift AltGr (a Key)
Any more than three is deemed to be elbows on the keyboard.
I believe this can be altered, but alas not by me. Dave Kreskowiak may know this. Ask him,
------------------------------------
"Possessions make you poor, wealth is measurable only in experience."
Sun Tzu 621BC
|
|
|
|
|
I adapted Larson's code just slightly (you need to disable TextBox1 by the way):
Private WithEvents _KeyDown As New List(Of Int16)
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If Not _KeyDown.Contains(e.KeyCode) Then
_KeyDown.Add(e.KeyCode)
TextBox1.Text &= Chr(e.KeyCode)
End If
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If _KeyDown.Contains(e.KeyCode) Then
_KeyDown.Remove(e.KeyCode)
TextBox1.Text = TextBox1.Text.Remove(TextBox1.Text.IndexOf(Chr(e.KeyCode)), 1)
End If
End Sub
I managed to press more than 2 keys, but not all combos work, and some combos act like alt+ctrl etc. and other combos somehow work without a hitch.
My advice is free, and you may get what you paid for.
|
|
|
|
|
The is the normal max that will work reliably.
If you want more than that, you're going to have to go to DirectX and it's DirectInput library, or use the XNA Framework (C#) to simplify using all the DirectX stuff.
|
|
|
|
|
|
Hi all,
i used the following code to get the registerd dll full path
Dim ins As RegistryKey
ins = Registry.ClassesRoot.OpenSubKey("RuleProcessor.Processor")
Dim clsid As String = ins.GetValue("").ToString
ins.Close()
Dim clsidKey As RegistryKey = Registry.ClassesRoot.OpenSubKey(clsid)
Dim manifestLocation As String = clsidKey.GetValue("CodeBase").ToString
clsidKey.Close()
RuleProcessor.Processor is the progId
but it doesn't work, i want to know where is the error
Thanks
|
|
|
|
|
What do you mean by it doesn't work?
Does it throw an exception? Does it give an unexpected result?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
yes at this line
Dim manifestLocation As String = clsidKey.GetValue("CodeBase").ToString it get this error
object reference to set to an instance of object
|
|
|
|
|
Almost certainly the error is referring to clsidkey , because it is null.
I could tell you why it is null, but you will learn far more by debugging this section of code. Step through it and observe where one of your variables becomes null, when you don't expect it to be.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i debug the code many and many times
<br />
ins = Registry.ClassesRoot.OpenSubKey("RuleProcessor.Processor")<br />
Dim clsid As String = ins.GetValue("").ToString<br />
the result of these lines is clsis = RuleProcessor.Processor
so i think that the ins will be equal to clsidkey
<br />
<br />
Dim clsidKey As RegistryKey = Registry.ClassesRoot.OpenSubKey(clsid)<br />
clsidkey not null
so it you know any other solution tell me please
Thanks for your help
|
|
|
|
|
OK.
And when you move the mouse pointer over the various terms in the error line:
Dim manifestLocation As String = clsidKey.GetValue("CodeBase").ToString
which one shows up as nothing?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
clsidKey.GetValue("CodeBase").ToString
i think the property codebase is null
|
|
|
|
|
Check the registry manually for the existence of CodeBase.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
exist, i checked it yasterday and i found the path exist in the codebase
|
|
|
|
|
Hi guys,
I want to read a comma delimited text file from the second line only.I can currently read all the lines, but i want to omit the first line and skip to the next. This is the code that reads all the lines.Can anyone assist.
Dim myReader As New IO.StreamReader(browselocation2.FileName)
Dim filestream As StreamReader
filestream = myReader
Dim readcontents As String
While myReader.Peek() <> -1
readcontents = filestream.ReadLine
Dim textdelimiter As String = ","
Dim splitout = Split(readcontents, textdelimiter)
Dim sql As String = ""
Debug.Print(splitout(0))
End while
Thanks in advance
|
|
|
|
|
If you are sure the file has at least one line just do readcontents = filestream.ReadLine before the While.
If you are not sure wrap it in an If myReader.Peek() <> -1 Then .
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
HI
try this...
dim lp
lp = 1
While myReader.Peek() <> -1
readcontents = filestream.ReadLine
if lp > 1
Dim textdelimiter As String = ","
Dim splitout = Split(readcontents, textdelimiter)
Dim sql As String = ""
Debug.Print(splitout(0))
end if
lp +=1
End while
|
|
|
|
|
Read the whole file and just ignore the first line.
|
|
|
|
|
Seems logical to me.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Thanks guys,
I just decided to read the first line and ignore posting it to the db .Seems very easy when its said that way doesn't it?well it is..Thanks 4 the help people. Its much appreciated.
Regards
|
|
|
|
|
How to colorize partial background of item in rowset of listview?
example:
have my_var=75 colorize 3/4 of item, have my_var=50 colorize 1/2 of itema, have my_var=72 colorize ecc...
Similar a progressbar but stop for filling item based value in my_var...
|
|
|
|
|
Investigate the OnDrawItem and OnDrawSubItem methods.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi... but i need for vb6 classic.... no net
|
|
|
|
|
In that case try here[^].
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|