Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey Guys,

 

I have been having a few problems trying to get all the letters in a textbox to split.

 

I want to get any letters that the user types in a textbox to be split into each different letter.

 

The end result will be that i can check each letter and cross reference it with a number.

 

E.G. r returns 32, e returns 54

 

This is going to be done for every letter that the user types,

 

Any help would be great appreciated! Thanks.

Posted
I'm not sure, but you should be able to attach to the TextBox.KeyPressed Event which sould give you the keycode of the key that was pressed.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

If you want to do all the processing after the user is finished typing (not using an event like I mentioned earlier).

 

You may use a foreach loop like this.

 

foreach(char c in yourTextBox.Text)
   // perform action on c

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

Is this what you are looking for:

 

       Dim TheChars() As Char = TextBox1.Text.ToCharArray()
       For Each TmpChar In TheChars
           Debug.Print(TmpChar & " = " & Asc(TmpChar))
       Next

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...