Results 1 to 3 of 3

Thread: {RESOLVED} Uppercase at KeyPress Event

  1. #1

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Resolved {RESOLVED} Uppercase at KeyPress Event

    Hello,

    I'd like to ask something about changing what we type into uppercase char. At the old VB version, I used to use below code :

    [vbcode]
    'I write below code at keypress event handler
    Char = Chr(Keyascii)
    Keyascii = Asc(Ucase(Char))
    [/vbcode]

    The code above will change every keypress of Char to Uppercase without having to press SHIFT and/or CAPSLOCK button.

    And now, I'm using C#, and I want to make a similar code to my text object. How should I do that ?

    Regards,
    ~WJ~
    Last edited by Wen Lie; Jul 2nd, 2007 at 06:01 AM. Reason: resolved...

  2. #2
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: Uppercase at KeyPress Event

    In .NET the textbox control has character casing property you could set it to normal, lower and upper.

    this.textBox1.CharacterCasing = CharacterCasing.Upper;

  3. #3

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Cool Re: Uppercase at KeyPress Event

    Thanks Marzim,

    It's work, and simpler than the old one in VB.
    ^_^
    I guess it right, that .NET really make it simple in coding.

    Regards,
    ~WJ~

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