單擊按鈕,生成0,100之間的隨機整數,顯示於

時間 2021-12-25 18:24:12

1樓:匿名使用者

vb.net乎?課本上就有啊!靠,這個你也問,懶得很啊!!

2樓:匿名使用者

dim x as integer

private sub command1_click()randomize

dim a(20) as integer

for i = 1 to 20

a(i) = int(rnd * 100)text1 = text1 & " " & a(i)if x < a(i) then x = a(i)next i

end sub

private sub command2_click()text2 = x

end sub

3樓:

dim a(19) as integer

private sub command1_click()text1.text = ""

for i = 0 to 19

a(i) = fix(rnd * 101)text1.text = text1.text & a(i) & " "

next

text1.text = rtrim(text1.text)end sub

private sub command2_click()temp = a(0)

for i = 1 to 19

if a(i) > temp then

temp = a(i)

end if

next

text2.text = temp

end sub

vb題目 單擊「生成隨機數」按鈕,隨機生成兩3位正整數M N分別顯示在對應文字框中

使用 random類 可以實現。private sub button1 click sender as object,e as eventargs handles button1.click dim newrandom1 as new random dim newrandom2 as new ran...

在windows中單擊開始按鈕就可以開啟

是的。或者你可以摁鍵盤上的圖示,如下圖。如果你是要開啟資料夾的選單,你可以一起摁如下圖的鍵。microsoft windows,是美國微軟公司研發的一套作業系統,它問世於1985年,起初僅僅是microsoft dos模擬環境,後續的系統版本由於微軟不斷的更新公升級,不但易用,也慢慢的成為家家戶戶人...

vb程式設計從文字框輸入年份n單擊判斷按鈕

網海1書生 private sub command1 click dim n as long n val text1.text if n 0 then if n mod 4 0 and n mod 100 0 or n mod 400 0 then text2.text n 是閏年 else tex...

VB怎樣編寫單擊按鈕自動開啟兩個網頁。高手截圖一下。懸賞分追加

private declare function shellexecute lib shell32.dll alias shellexecutea byval hwnd as long,byval lpoperation as string,byval lpfile as string,byval ...