Results 1 to 4 of 4

Thread: [2.0] Textbox Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    87

    [2.0] Textbox Question

    how can i make my input to be all capital only?
    and disable special character?

    thank you.
    I Hope I Could be Great Like You

  2. #2
    Lively Member Dominator's Avatar
    Join Date
    Oct 2004
    Location
    Egypt
    Posts
    65

    Re: [2.0] Textbox Question

    Hi, try this.

    Code:
            public Form1()
            {
                InitializeComponent();
                textBox1.KeyPress+=new KeyPressEventHandler(textBox1_KeyPress);
            }
            private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (!(char.IsLetterOrDigit(e.KeyChar) || (Keys)e.KeyChar == Keys.Back))
                {
                    e.Handled = true;
                }
                e.KeyChar = char.ToUpper(e.KeyChar);
            }
    .........................................................
    John F. Gouda {A.K.A}{Dominator Legend}
    Software Engineer
    +20-0125113313
    .......................................................
    Please feel free to download my projects:
    Http://DominatorLegend.Co.Nr
    .................................................................................................... ................................................................................................
    Direct Library | Speech Library | System Locker V.3 | Magic Encryptor | And many many more, follow the link above...

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Textbox Question

    For the casing you could set the CharacterCasing property of the control to Upper instead of the default Normal.

    I always recommend checking to see what members a class has before asking questions. The answers are often obvious but you have to look first. If nothing obvious presents itself, then ask.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    87

    Re: [2.0] Textbox Question

    thanks sir.
    I Hope I Could be Great Like You

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