How would I be able to capitalize the first letter in a textbox?

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
DanielJohnson
Posts: 6
Last visit: Tue Feb 02, 2021 11:54 pm

How would I be able to capitalize the first letter in a textbox?

Post by DanielJohnson »

How would I be able to capitalize the first letter in a textbox?

For example:
textboxFirstname.text = 'john' -> 'John'

textboxLastname.text = 'doe' -> 'Doe'
by jvierra » Mon Dec 14, 2020 2:21 am
$letter = $textboxLastname.text[0]
Go to full post
Top
User avatar
owinsloe
Posts: 161
Last visit: Mon Mar 18, 2024 12:33 pm
Been upvoted: 1 time

Re: How would I be able to capitalize the first letter in a textbox?

Post by owinsloe »

try this
$textboxFirstname.text = (get-culture).textinfo.totitlecase($textboxFirstname.text)
This topic is 3 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked