Results 1 to 3 of 3

Thread: TextBox Question

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    TextBox Question

    If you had two textboxes and in the first one the user typed a number such as 15. How would you get it to say Fifteen in the second textbox?
    Last edited by System_Error; Apr 30th, 2004 at 06:49 PM.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    There is always the long way;

    Select case val(txt1.text)
    case 1
    txt2.text="One"
    etc
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3
    Member michaeljustman's Avatar
    Join Date
    Apr 2004
    Posts
    52
    Make an array of a string variable and have each of the values of the array hold the text for the name of number. (This would only work if you were willing to type in up to the number that you needed in text.) For example:

    VB Code:
    1. Public NText$(9) As String
    2.  
    3. NText$(0) = "Zero"
    4. NText$(1) = "One"
    5. NText$(2) = "Two"
    6. NText$(3) = "Three"
    7. NText$(4) = "Four"
    8. NText$(5) = "Five"
    9. NText$(6) = "Six"
    10. NText$(7) = "Seven"
    11. NText$(8) = "Eight"
    12. NText$(9) = "Nine"
    13. 'NText$(n) = "(English Equivilant)"
    14. '....on forever

    Then when you needed it. You could refrence the variable in your code.

    VB Code:
    1. Sub Text1_Change
    2.     If IsNumeric(Text1.Text) = True THEN Text2.Text = NText$(VAL(Text1.Text))
    3. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width