Jump to content
1000DotS

Visual Basic Ucase->Lcase and viceversa

Recommended Posts

Salutare,

Ma chinui de ceva timp cu o chestie, si nu ii dau de capat.

Problema este in felul urmator:

-- am o forma in care am un TextBox

-- vreau ca in timp ce tastez ceva in acel TextBox, daca introduc de la tastatura o litera mica "a", sa mi-o scrie ca litera mare "A", si invers...adica daca introduc "A" sa imi scrie "a"

-- problema nu se pune pentru un singur caracter, si pentru un sir de caractere.

-> Din cate imi dau seama, are ceva legatura cu evenimentele KeyDown/KeyPress !? sau e TextChanged?

Multumesc

Link to comment
Share on other sites

Interceptezi evenimentele de tip KeyPress si verifici daca Capslock este activ sau daca Shift este si el apasat.

Interceptand evenimentele de tip KeyPress interceptezi doar caracterele alfanumerice, daca interceptezi KeyDown/KeyUp alea iti intercepteaza si caracterele celelalte(shift, f1, del, home, smd).

aici ai un exemplu de folosire pentru keypress desi ei definesc clasa ca handler pentru KeyDown. Inlocuieste "handles textbox.KeyDown" cu "textbox.KeyPress".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...