|
-
Dec 14th, 2001, 04:32 AM
#1
Thread Starter
New Member
how to: press a command button by code
something like:
sub text1_keypress(keyascii as integer)
if keyascii=48 then
command0.press
end if
end sub
-
Dec 14th, 2001, 04:40 AM
#2
Addicted Member
command1_click
Just call the procedure that handles the click event
-
Dec 14th, 2001, 04:42 AM
#3
Thread Starter
New Member
tnx, but i know it
i need that le button is pressed while i'm writing on the keyboard, like the windows calculator does.
i'm sorry 'bout my english
-
Dec 14th, 2001, 05:16 AM
#4
New Member
Hey!!!
Use the Sendkeys method!!
pari
-
Dec 14th, 2001, 05:16 AM
#5
Hyperactive Member
can you make yourself more clear.
windows calculator just does as suggested by supster. only difference is you cant make out the time difference bet click and display of character
-
Dec 14th, 2001, 05:22 AM
#6
Junior Member
Why dont you just disable it once and enable it again..simple man
-
Dec 14th, 2001, 05:51 AM
#7
Well ...
Originally posted by biifu
something like:
sub text1_keypress(keyascii as integer)
if keyascii=48 then
command0.press
end if
end sub
I have a very crude solution.
On a form, place a Checkbox, with its Style property set to 1-Graphical. Set the KeyPreview property of the form to True, and then paste the following code in the form's code window:
VB Code:
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim I As Long, J As Long
If KeyAscii = Asc("1") Then
Check1.Value = 1
Me.Refresh
For I = 0 To 1000
For J = 0 To 1000
Next
Next
Check1.Value = 0
Me.Refresh
End If
End Sub
Run the project and when the form with the checkbox appears, press 1 to see the effect.
.
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
|