.net - Sentence case or proper case in a TextBox -



.net - Sentence case or proper case in a TextBox -

i want textbox create text come in sentence case(propercase).. don't want write code in event lost focus or keypress.

just default, whenever user enters or types in textbox first letter of every word should automatically converted uppercase.

i don't know of way in winforms without putting code in event. charactercasing property of textbox allows forcefulness characters entered upper or lower case, not proper casing. incidentally, it's single line of code in event:

textbox1.text = strconv(textbox1.text, vbstrconv.propercase)

a more generic handler doing across multiple textboxes involves attaching number of events same code:

'attach multiple events handler private sub makepropercase(sender object, e eventargs) handles _ textbox1.lostfocus, textbox2.lostfocus, textbox3.lostfocus 'get caller of method , cast generic textbox dim currenttextbox textbox = directcast(sender, textbox) 'set text of generic textbox proper case currenttextbox.text = strconv(currenttextbox.text, vbstrconv.propercase) end sub

in asp.net, can without code; there's css property called text-transform, 1 of values property capitalize. when applied text input element, makes first letter of each word uppercase.

.net vb.net textbox

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -