Hi! I want upper first letter name in textbox c# windows Application. I want input only name or last first and fathers name. For example input:
rustam
or
pulodov rustam abdulloevich
output result:
Rustam
Pulodov Rustam Abdulloevich
Hi @PRA,
Use following code...
function myFunction(txt) { txt.value = txt.value.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); }
Hi PRA,
Firt fetch the record from textbox and on textchange reassign the value to again to the textbox with TitleCase like below.
string text = txtText.Text.Trim(); txtText.Text = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(text.ToLower());
When I write one letter in textbox cursor go to left right. It's problem.
Hi PRA.
Use TextBox Leave event.
C#
private void textBox1_Leave(object sender, EventArgs e) { (sender as TextBox).Text = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((sender as TextBox).Text.ToLower()); }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.