473,327 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

e.keychar

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
Jul 21 '05 #1
4 5067
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
Jul 21 '05 #2
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!
Jul 21 '05 #3
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
Jul 21 '05 #4
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
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wiktor Zychla | last post by:
in my application I sometimes use KeyPress event. in the event handler I have to check the char the user is trying to type. in NTs everything is correct. however on W98 I've noticed that the...
1
by: Top Gun | last post by:
I am trying to trap on a keypress "+" event and convert it to a tab for a high-speed dataentry form that is done entirely from a 10-key. However, I do NOT want the "+" character to be passed on to...
3
by: Baz | last post by:
Hi All, In VB6, I had text boxes which, in I wanted to allow numeric data only. To do this, I put some code in the KeyPress event of the control, and if the key that was entered was outside the...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
4
by: Rockfrdcpl | last post by:
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...
0
by: flameboy | last post by:
I am currently trying to figure my way how to output strings to a file. I have seen all the many posts and such how to do it in a console program, and have had much success doing it that way. This...
0
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the...
7
by: tekeste | last post by:
Private Sub combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbcombobox1.KeyPress If Asc(e.KeyChar) = Keys.Enter Then ...
5
lotus18
by: lotus18 | last post by:
Hello World! I have a sample code here written in vb .net that restricts the textbox to accept only alpha, alphanumeric or numeric characters. Public Enum MyOption Alpha = 1 ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.