Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key Press

Status
Not open for further replies.

prprogrammer

Programmer
Jun 25, 2004
49
PR
HI I Have a form with text,combo,etx,, I want when the user press the + in the key that call a sub no matter the user is on a combo or textbox...
 
you should code each event for each control i.e.

private sub textbox1_keydown(keyascii as integer)
mySub
End sub
private sub combo1_keydown(keyascii as integer)
mySub
End sub

public sub mySub(KeyAscii as integer)
..do whatever
end sub



"I'm living so far beyond my income that we may almost be said to be living apart
 
prprogrammer,

Set the KeyPreview property of the Form to True

From VS6 help
<<
Returns or sets a value that determines whether keyboard events for forms are invoked before keyboard events for controls. The keyboard events are KeyDown, KeyUp, and KeyPress.
>>

regards Hugh

 
I think you may use the Microsoft form2 object library to
solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top