1樓:匿名使用者
下面是簡單實現,需要帶入引數是大於等於1的正數(自己防呆)private sub command1_click() '呼叫例項dim str as string
msgbox return_str(5)
end sub
private function return_str(number as integer) as string '通用函式
dim str as string
for i = 1 to number
dim str_temp as stringstr_temp = ""
' msgbox str_temp
for j = 1 to i
str_temp = str_temp & cstr(i)next
str = str & str_temp
next
return_str = str
end function
2樓:veket的小號
private sub command1_click()dim n as long
dim s as string
dim i as long
dim j as long
s = ""
n = val(text1.text)
for i = 1 to n
for j = 1 to i
s = s & i
next
next
text2.text = s
end sub
vb程式設計題在文字框1中輸入整數n判斷其能否
console.writeline 請輸入一個整數 int n n int.parse console.readline if n 5 0 n 7 0 console.writeline n 能夠同時被5和7整除 console.read elsew console.writeline n 不能夠同...
VB中,如何實現 當滑鼠點選文字框時,文字框內的提示字元會自
option explicit dim defs as string private sub form activate defs 請在這裡輸入 定義提示字元command1.setfocus 給按鈕置焦點end sub private sub text1 gotfocus 文字框得到焦點 if t...
VB中如何輸入文字框文字輸入字元,在這字元後加上
private sub text1 change if len text1.text 4 then text1.text text1.text end sub 我精心寫了一段哦!現在針對的是text1這個控制元件只需要放一個text1控制元件在窗體上在複製這段 貼上執行就可以了。我想了3種方法,一個...