e.keychar

  • Thread starter Thread starter Rockfrdcpl
  • Start date Start date
R

Rockfrdcpl

I am trying to use statements like "Select Case Asc(e.KeyChar)" in a sub
routine that is in a module that I call from different forms so I don't have to
type the series of statements several times in my program but I haven't figured
out the exact code to make it work. The program says I need an instance of it
but I can't seem to get it to accept that either................any
suggestions?

signed...........
Lost in trying to make Keypress work without duplicating routines
 
Hi,

Just give the reverence from the event to your routine. Know that by
instance the keypress and the keyUp have different events arguments and
therefore cannot be mixed up.

However by instance with keypress

Myroutine (byval e as KeyPressEventsArgs)

I hope that was what you did mean?

Cor
 
I guess it needs more explaination. My sub routine has that already in there
but I am trying to remove part of the subroutine into a routine that I call
from the sub routine. The e.keychar is what I am removing out. The called
routine will be in another form even though I need to access it from all the
form of the application. I hope I've explained this better!
 
Hi R..........

If you want to do things like this, you can make a normal and even a
Static/Shared (C#/VB.net) class for that.

However I would do that never in another form, that is very bad
programming.

Cor
 
Hello again and thanks for the response.........sorry it took me a while to
respond again......was on a vacation..........the reason I want to go the route
I am going is because it's only about 2 or 3 lines of code so I didn't want to
make a class for that..........I was hoping to find a way to do it in a call
statement and still refer to specific controls in the forms but maybe I am
dreaming and it can't be done..................if you have further info I would
appreciate it.........if not thank you very very very much for responding

signed,
Still lost
 
Back
Top