Results 1 to 4 of 4

Thread: control keyChar from InputBox?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    4

    control keyChar from InputBox?

    Is there a way to control the KeyChar from an InputBox? If so, can you point me in the right direction? I know I can do it with a textbox but wasn't sure if possible with an inputBox. Thanks in advance!

  2. #2
    Member
    Join Date
    Feb 2006
    Posts
    61

    Re: control keyChar from InputBox?

    at least not at runtime.. but when the user press's ok you could look at the output and give an error message and promt to input again... i would advise to not use input boxes if you plan to restrict keys... keeps everything simple and nice... (my opinion)...

  3. #3
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: control keyChar from InputBox?

    The only possible way I see it is somehow catching keys that get sent to your program while the input box is up, and editing the ascii so that when it's invalid set the ascii to 0 which is nothing. I'm not even sure that would work, but like c0rrupt said I wouldn't use an inputbox.
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  4. #4
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: control keyChar from InputBox?

    If you know how to do it with a textbox, then simply make a form that looks like an input box and put a text box on the form. Then use the DialogReturn property of the form to have the form return a value when DialogShow is called.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

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