|
-
Apr 29th, 2002, 05:13 AM
#1
Thread Starter
Hyperactive Member
Anyone know how the DEL could be captured?
in a textbox.. is it not possible to capture the DEL button when pressed? and do something with it.... as i couldint get it to work. It works fine for the Backspace though.
Private Sub Text1_KeyPress(KeyAscii As Integer)
if KeyAScii = 8 then 'this is for backspace..which works)
do something
end if
----
however.. the following does not work.. which is for DEL
if keyAscii = 127 then
do something
end if
any ideas?
cheers
Abe
1+1=3
make life simple, use a calculator!
-
Apr 29th, 2002, 05:16 AM
#2
Re: Anyone know how the DEL could be captured?
Originally posted by Abdulrahman
in a textbox.. is it not possible to capture the DEL button when pressed? and do something with it.... as i couldint get it to work. It works fine for the Backspace though.
Private Sub Text1_KeyPress(KeyAscii As Integer)
if KeyAScii = 8 then 'this is for backspace..which works)
do something
end if
----
however.. the following does not work.. which is for DEL
if keyAscii = 127 then
do something
end if
any ideas?
cheers
Abe
Use this:
Last edited by Nightwalker83; Dec 13th, 2007 at 07:46 PM.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 29th, 2002, 05:27 AM
#3
Thread Starter
Hyperactive Member
re:
thanx but this does not show a value for the DEL button..
i looked at some ASCII code charts... and it gave the ASCII value for DEL (Delete button) as 127.
However I am finding no way of capturing the button to set off a few events when user does press the DEL button.
any ideas anyone?
Abe
1+1=3
make life simple, use a calculator!
-
Apr 29th, 2002, 05:32 AM
#4
VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyBack Then
MsgBox "Rubout key pressed."
ElseIf KeyCode = vbKeyDelete Then
MsgBox "Delete key pressed."
End If
End Sub
This world is not my home. I'm just passing through.
-
Apr 29th, 2002, 05:35 AM
#5
Re: re:
Originally posted by Abdulrahman
thanx but this does not show a value for the DEL button..
i looked at some ASCII code charts... and it gave the ASCII value for DEL (Delete button) as 127.
However I am finding no way of capturing the button to set off a few events when user does press the DEL button.
any ideas anyone?
Abe
Download the file again because I've changed it.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 29th, 2002, 05:44 AM
#6
Thread Starter
Hyperactive Member
re:
thanx..
i was trying to get it to work on the Keypress event...along with the other ones..
but i'v just found a workaround.. will just use sendkeys function
thanks!
Abe
1+1=3
make life simple, use a calculator!
-
Apr 29th, 2002, 06:01 AM
#7
i have a value of 46 for Del on my VB ascii chart...
-
Apr 29th, 2002, 06:11 AM
#8
Originally posted by Si_the_geek
i have a value of 46 for Del on my VB ascii chart...
It Keycode not Ascii but your right about the 46.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 29th, 2002, 06:17 AM
#9
Thread Starter
Hyperactive Member
yes but could you guys actaully do something with it??
like if keyAscii = 46 then.......
coz i couldint get that to work..
Abe
1+1=3
make life simple, use a calculator!
-
Apr 29th, 2002, 06:29 AM
#10
Originally posted by Abdulrahman
yes but could you guys actaully do something with it??
like if keyAscii = 46 then.......
coz i couldint get that to work..
Abe
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Then
MsgBox ("Yes this works.")
End If
End Sub
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 29th, 2002, 06:37 AM
#11
Thread Starter
Hyperactive Member
ah right keycode.. what I mean is that you cant use the KeyAscci codes.. for the DEL button.. keycode=46 works.. but KeyAscci = 127 does not.. anyhow... thanks a lot
Abe
1+1=3
make life simple, use a calculator!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|