佳木斯湛栽影视文化发展公司

主頁 > 知識(shí)庫 > 用vbscript實(shí)現(xiàn)啟用 Caps Lock (大寫)鍵

用vbscript實(shí)現(xiàn)啟用 Caps Lock (大寫)鍵

熱門標(biāo)簽:鐵路電話系統(tǒng) 服務(wù)器配置 檢查注冊(cè)表項(xiàng) 呼叫中心市場(chǎng)需求 美圖手機(jī) 智能手機(jī) 銀行業(yè)務(wù) 網(wǎng)站文章發(fā)布
問:
嗨,Scripting Guy!I have a script where users enter some information in an Input box.The information needs to be entered in all-capital letters, so my instructions say, “Please make sure the Caps Lock key is on before entering the information.”They don't always do that, however.Is there a way to turn the Caps Lock key on and off using a script?
-- BW, Medford, OR
答:
Hey, BW.We don't know of a way to turn the Caps Lock key on and off, but we do know a way to mimic the effect of having the Caps Lock key on.After all, the whole point of the Caps Lock key is to turn everything you type into uppercase letters.For example, you might type this:
this is my sentence.
But Caps Lock will make it appear on screen like this:
THIS IS MY SENTENCE.
So how can we achieve the same affect in a script?簡(jiǎn)單:we just use the VBScript function UCase, which switches all the letters in a string to their uppercase equivalent.For example, here's a simple two-line script that gathers information from a user and then uses the UCase function to switch all the letters to uppercase when echoing the value to the screen:
strMessage = InputBox("Please enter your message:")Wscript.Echo UCase(strMessage)
Incidentally, the above script doesn't actually change the case of the letters in the string strMessage; it just displays them in uppercase.If you really want all the letters converted to uppercase, try this script instead:
strMessage = UCase(InputBox("Please enter your message:"))Wscript.Echo strMessage
Looks crazy, but it works.
For more information about the UCase function, see theVBScript 文檔 on MSDN.

標(biāo)簽:河南 樂山 上海 新疆 紅河 滄州 長(zhǎng)治 沈陽

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《用vbscript實(shí)現(xiàn)啟用 Caps Lock (大寫)鍵》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    武城县| 东乡县| 延吉市| 滨州市| 凯里市| 新沂市| 邮箱| 万全县| 柳州市| 枣阳市| 梁平县| 苗栗县| 南川市| 沙河市| 东阿县| 崇明县| 嘉祥县| 田东县| 山东| 平昌县| 泸水县| 唐山市| 富蕴县| 海宁市| 长白| 大荔县| 保康县| 南涧| 拉孜县| 休宁县| 聂荣县| 高陵县| 陆丰市| 定陶县| 怀仁县| 乌兰浩特市| 论坛| 泰安市| 莱州市| 兴文县| 太白县|