Hi All,
I'm trying to create a custom input textbox with below code. I want to set character casing such a way that when any try to input something in that text-box, its shown in UPPERCASE always. I'm not getting any help with ToUpper(). Below is my code:
********************************************************
Function Show-Inputbox {
Param(
[string]$message=$(Throw "You must enter a prompt message"),
[string]$title,
[string]$default
)
[reflection.assembly]::loadwithpartialname("microsoft.visualbasic") | Out-Null
[microsoft.visualbasic.interaction]::InputBox($message,$title,$default)
}
$AppName = Show-Inputbox -message “Please enter the application name.” -title "Get the application"
********************************************************
Let me know how I can put logic so that whatever is typed in text-box is in UPPERCASE.
Thanks in advance.
TextBox input always in UPPERCASE
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.
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.
Re: TextBox input always in UPPERCASE
Hi there,
My input is getting stored in $AppName and if I try something like below, it does not work:
$AppName.CharacterCasing='Upper'
Earlier also I thought for character casing but somehow its not working for me. Can you tell me what snippet I need to add in my code(shown above) as this is the custom text box.
My input is getting stored in $AppName and if I try something like below, it does not work:
$AppName.CharacterCasing='Upper'
Earlier also I thought for character casing but somehow its not working for me. Can you tell me what snippet I need to add in my code(shown above) as this is the custom text box.
- MikeFRobbins
- Posts: 8
- Last visit: Thu Apr 11, 2019 1:55 pm
Re: TextBox input always in UPPERCASE
One thing to be aware of is that using conversions like .ToUpper() to do case insensitive comparisons can be problematic. Depending on the situation and what you're using it for, you may want to make sure your code passes the Turkey Test. I wrote a blog article about this problem if you're interested in more information.
Mike F Robbins
Microsoft MVP, SAPIEN MVP
Microsoft MVP, SAPIEN MVP