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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KeyCode and Icon in toolbar

Status
Not open for further replies.

Visitante

Technical User
Nov 26, 2004
2
HN
Hi,

I'm making an application in VB6.
I just want to use the number keys, if the user press other key it does not make nothing (this in a textbox).
I have other question... I want to make an application that run in background... Instead of minimizing the window, I want the window stays not visible and appears one icon next to the clock in the toolbar of windows. It's possible?

Thanks in advance ;)
 
The textbox: you either use txtbox.locked = true or if you want to capture the keyascii use: in the textbox on keypress use keyascii = 0 exit sub and on keydown use keycode = 0 exit sub. The icon next to the time is referred to as the system tray. Do some searches on adding your vb app to the system tray.
 
For putting your icon to the system tray, use this


For the Keypress Stuff,

Check the Keycode in text1_Keydown event, like this
Dim KeyCode_of_1 as Integer 'Assign this the Ascii Value of 1 or 0
Dim KeyCode_of_9 as Integer 'Assign this the Ascii Value of 9

If Keycode < KeyCode_of_1 and Keycode > KeyCode_of_9 then
KeyCode=0
End if All the Best
Praveen Menon
pcmin@rediffmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top