小知識

關於dim storestring as string的

Dim storestring As String

Private Sub Command1_Click()
Text1.Text = storestring
Command1.Enabled = False

End Sub

Private Sub Command2_Click()
storestring = Text1.Text
Text1.Text = "" '清除
Command1.Enabled = True
 

解析:

Dim storestring As String '定義全局變量storestring爲字符串類型

Private Sub Command1_Click() '名稱爲Command1的按鈕的單擊事件

Text1.Text = storestring'將storestring中的數據賦予text1;(即在text1文本框中顯示storestring中的數據)

Command1.Enabled = False '將名稱Command1這個按鈕設置爲無效

End Sub


Private Sub Command2_Click() '名稱爲Comamnd2的按鈕的單擊事件

storestring = Text1.Text '將Text1文本框中的數據賦予storestring

Text1.Text = "" '清除Text1文本框中的內容

Command1.Enabled = True '將名稱爲Command1的按鈕設置爲有效

End Sub


相似的:

 

if text1.text = "hello" then
msgbox "hello"
else
msgbox "bye"
end if

如果text1的內容是hello
則提示hello
否則不管什麼內容都是bye

 

(此內容來自互聯網~)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章