473,671 Members | 2,283 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 5096
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 KeyPressEventsA rgs)

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
1739
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 character given in e.KeyChar (e is KeyPressEventArgs of course) is NOT correctly converted ToString() when I type polish specific letters! instead of the letter 'polish l' I get '3', instead of 'polish z' I get '?'
1
4867
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 the textbox. I am using code similar to this: public class FastEntryControl : TextBox { protected override void OnKeyPress(KeyPressEventArgs e) {
3
14828
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 range of 0-9, then I reset the KeyAscii prperty to 0. Thus: Private Sub tTransactionAmount_KeyPress(KeyAscii As Integer) If Keyascii < 48 Or Keyascii > 57 Then Keyascii = 0 End Sub
11
4542
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 opinion of how I want to handle the 'user experience' in the application I'm creating. While I know I could allow the user to enter in number and alpha text - in a text box - and then tell them when the execuate a command "This is not numeric data", I...
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 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...
0
1610
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 is a gui app though. What I want to be able to do is take strings from a text box, output those strings to char arrays, and then output the char arrays to a text file. Here is what I have so far: void __fastcall TForm1::Button1Click(TObject...
0
11983
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 form controls so
7
10834
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 textbox2.Focus() End If End Sub i want just press enter key to go to the next textbox2 after selecting combobox1, but it's not working. it works fine for for navigating through textboxes, but not for combobox, Please help.
5
28584
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 AlphaNumeric = 2 Numeric = 3 End Enum
0
8474
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8597
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8669
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.