FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Enum Letters On Phone KeyPad And Convert
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Smart Device Application
View previous topic :: View next topic  
Message
Author
Jon Turlington
Newbie
Joined: 07 Jul 2006
Posts: 2

PostPosted: Fri Jul 07, 2006 1:00 am    
Post subject: Enum Letters On Phone KeyPad And Convert
Reply with quote

Here is what I have but it's definately not working.

I am trying to have a text box with letters in it and if someone where to try entering a word from a phone keypad and it came out as numbers what those numbers would be.

Here's my failing attempt but maybe some one can steer my ship in the right direction:

<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.ComponentModel" %>

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



http://www.w3.org/1999/xhtml" >

Untitled Page








OnClick="Button1_Click" />







 

Back to top
View user's profile Send private message
Author
Jon Turlington
Newbie
Joined: 07 Jul 2006
Posts: 2

PostPosted: Fri Jul 07, 2006 4:00 am    
Post subject:
Reply with quote

Here is what I have but it's definately not working.

I am trying to have a text box with letters in it and if someone where to try entering a word from a phone keypad and it came out as numbers what those numbers would be.


Here's my failing attempt but maybe some one can steer my ship in the right direction:


<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.ComponentModel" %>


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





http://www.w3.org/1999/xhtml" >

Untitled Page








OnClick="Button1_Click" />







 

Back to top
View user's profile Send private message
Author
Cerebrus
Intermediate
Joined: 03 Jul 2006
Posts: 342

PostPosted: Sun Jul 16, 2006 1:00 pm    
Post subject:
Reply with quote

Simple :

In your Button Click event, change the For Each loop to :
-------------------
For Each Chr In TextBox1.Text
Label1.Text += CStr([Enum].Parse(GetType(Phone), Chr.ToString(),
True))
Next
-------------------

What we're basically doing here, is supplying the string representation of the Enum and we want to get the numeric constant associated with it.
The Parse method allows us to do that. Note that if an space is entered in the text, your program will give an exception. You can decide how to handle this. (Maybe you could substitute a 0 for spaces...)

HTH,

Regards,

Cerebrus.



 

Back to top
View user's profile Send private message
Author
JonTurlington
Newbie
Joined: 19 Jul 2006
Posts: 5

PostPosted: Wed Jul 19, 2006 1:00 am    
Post subject:
Reply with quote

Thanks alot for the help!

I post things on the boards and they always seem ignored.

Jon



 

Back to top
View user's profile Send private message
Author
Cerebrus
Intermediate
Joined: 03 Jul 2006
Posts: 342

PostPosted: Thu Jul 20, 2006 1:00 am    
Post subject:
Reply with quote

Well, some newsgroups have less activity, and some have so much activity, that it's difficult to keep up.

I monitor a lot of groups including this one, but I'm usually found posting in <http://groups.google.com/group/DotNetDevelopment>

Have a nice one,

Regards,

Cerebrus.



 

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Smart Device Application All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS