473,513 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5082
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
1715
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
4848
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
14821
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
4514
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
302
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
1601
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
11946
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
10811
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
28509
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
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.