473,399 Members | 3,603 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,399 software developers and data experts.

Create an instance of System.Windows.Form.KeyEventArgs

vinci
62
Help Me!!!! T_T


I want to create an instance of System.Windows.Forms.KeyEventArgs in vb.net for me to be able to use the .keyCode method of that class...is this possible???

basically, i want to create an instance of it in my txtbox_textchange event this is for monitoring the input of the user, if the user typed in a Space (keyCode 32) then it will not permit the user to type in again.. basically thats how i want it to be...

for u guys to understand me, (hehehe) i am trying to make a program that adds user accounts (included in it is the email) so basically, when i input the firstname, lastname of the user it will automatically generate the email of that person
eg.
firstname = vinci
lastname = code
email would be:
vinci.code@domain.net

when i input the first name like this: "vinci vinci"
then the program will only take the first name "vinci" the 2nd it disregards so with the lastname. this is i think where i should place the keyeventargs (keyCode) method..

i used the event textChange because i wanted that when i input the first character of name or lastname it will automatically add that to the email's textbox.

eg. when i type "v" in the firstname textbox, then "v" would also be placed in the email textbox.

hope its clear... :)

ps. firstname and lastname have different textboxes

hope u talented, smart guys could help me!

needed your help,

vinci
Jul 3 '07 #1
1 3910
shweta123
692 Expert 512MB
Hi,

You can use Keypress event of textbox instead of TextChange. e.g

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

''''''''' Here you can get typed char using e.KeyChar() which you place into 2nd textbox also as per yout requirement

''''and get Ascii using Asc(e.keyChar()) e.g char 32 in your case
End Sub


Help Me!!!! T_T


I want to create an instance of System.Windows.Forms.KeyEventArgs in vb.net for me to be able to use the .keyCode method of that class...is this possible???

basically, i want to create an instance of it in my txtbox_textchange event this is for monitoring the input of the user, if the user typed in a Space (keyCode 32) then it will not permit the user to type in again.. basically thats how i want it to be...

for u guys to understand me, (hehehe) i am trying to make a program that adds user accounts (included in it is the email) so basically, when i input the firstname, lastname of the user it will automatically generate the email of that person
eg.
firstname = vinci
lastname = code
email would be:
vinci.code@domain.net

when i input the first name like this: "vinci vinci"
then the program will only take the first name "vinci" the 2nd it disregards so with the lastname. this is i think where i should place the keyeventargs (keyCode) method..

i used the event textChange because i wanted that when i input the first character of name or lastname it will automatically add that to the email's textbox.

eg. when i type "v" in the firstname textbox, then "v" would also be placed in the email textbox.

hope its clear... :)

ps. firstname and lastname have different textboxes

hope u talented, smart guys could help me!

needed your help,

vinci
Jul 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nate | last post by:
Hi All, I am having difficulty creating a new instance of a proxy for an XML Web Service in my Web Form Client (VB) .NET code. When I try to run my 'hello world' file, hw.aspx, I receive the...
6
by: SamIAm | last post by:
Hi am creating a email application that needs to mail out a very large amount of emails. I have created a multithreaded c# application that using message queuing. I have created a threadpool of 5...
11
by: Özden Irmak | last post by:
Hello, In my VB.Net application I create a new instance of my form like : NewForm = new MyNewForm() But with this line, this new form is automatically shown. I want it to be hidden at the...
9
by: S Wheeler | last post by:
Hi all - I am trying to create an instance of a vb .net class containing a form from unmanaged vc++. The vb.net is a dll. How to do this ? I am trying #import by can't seem to get it quite...
0
by: question | last post by:
Hi! I have a requirement where I need to display multiple forms one after the other like a slide show. These are in the same application. Basicall on selection of a menu item it should start...
4
by: Steven | last post by:
Hi, I have a database table field to store the form name, I want to create the particular windows form by using the value that read from that DB field. For examples, the table field has a value...
3
by: TheSebaster | last post by:
I would like to create an instance of System.Windows.Form.TextBox but I just have the name of the objec in a string like that: string strType = "System.Windows.Form.TextBox"; I tryed myOgject...
3
by: Sarang | last post by:
Hi, I have this code that makes the form as an MDIChild: chartWindowController.GetForm().MdiParent = _expertTradeMainFrm; chartWindowController.GetForm().WindowState =FormWindowState.Normal;...
3
by: David K in San Jose | last post by:
I'm using managed (CLR) C++ in VS2005 to create a Windows app that contains a form named "MyForm". In the code for that form I'm trying to invoke some static functions by using an array of function...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...
0
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...
0
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,...

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.