請教VB的簡單問題,請教一個VB的簡單問題!

2022-06-05 12:25:03 字數 979 閱讀 5733

1樓:匿名使用者

''先宣告一個函式..

private declare function getwindowsdirectory lib "kernel32" alias "getwindowsdirectorya" _

(byval lpbuffer as string, byval nsize as long) as long

''public function getwindowspath() as string

dim p as string * 80

dim length as long

dim path as string

length = getwindowsdirectory(p, len(p))

path = left(p, length)

getwindowspath = path

end function

''獲取

private sub command1_click()

text1.text = getwindowspath

end sub

懂了沒.我除錯過的.

2樓:匿名使用者

用getwindowsdirectory函式可以尋找windows目錄

private declare function getwindowsdirectory lib "kernel32" alias "getwindowsdirectorya" (byval lpbuffer as string,byval nsize as long) as long

private sub form_loaddim strbuffer as string *1024retval=getwindowsdirectory(strbuffer,1024)

are you know?

請教vb問題,請教乙個vb問題

註釋寫在 裡了,望採納 private sub command1 click text1.text visual basic 當單擊command1按鈕時,text1文字框會顯示 visual basic end sub private sub text1 lostfocus 當文字框text1失去...

請教高手乙個VB演算法的問題,三個VB的問題 求解

做個迴圈就行吧。好麻煩啊。private sub command1 click for i 1 to 4 f不可能等於1,至少為2,故a至多為4 for j 1 to 9 for k 1 to 9 for m 1 to 9 for n 1 to 8 if i j and i k and i m an...

請教vbs問題,關於vb的小問題

比如說乙個引數,變數或常量。關於vb的小問題 setmynum是乙個變數。val表示把括號後面的數轉化為10進製的數值形式。h是16進製制數字的開頭。寫在 裡面表示加上 h這兩個字元竄。如加號後面的數值 5的話,setmynum就等於val h5 這個意思。號後面的mid sur,11 4 1,4 ...