1樓:匿名使用者
注意:假設控制元件名稱如下圖所示:
在編寫**狀態,雙擊「黑體」文專字。即雙擊控制元件屬option1,出現如下**視窗:
option explicit
rivate sub option1_click()|end sub
在游標處輸入: text1.font.name = "黑體"
類似方法,分別雙擊 控制元件 option2、check1、check2,一一編寫**,完整的**如下:
option explicit
private sub check1_click()text1.font.bold = check1.valueend sub
private sub check2_click()text1.font.italic = check2.valueend sub
private sub option1_click()text1.font.name = "黑體"
end sub
private sub option2_click()text1.font.name = "宋體"
end sub
2樓:霧中的華
這些都很簡單,把執行的內容繫結到單擊事件中就可以了
一道vb程式設計題目,求大佬解答!!
3樓:匿名使用者
^private sub ***mand1_click()dim i as integer
for i = 11 to 999
if i = strreverse(i) and i ^ 2 = strreverse(i ^ 2) and i ^ 3 = strreverse(i ^ 3) then
print i, i ^ 2, i ^ 3end if
next
end sub
一道vb程式設計題目 求大佬解答!!!
4樓:聽不清啊
private sub ***mand1_click()dim x as integer, y as integerx = inputbox("請輸入一個正整數:")t = x
y = 0
doy = y * 10 + t mod 10t = t \ 10
loop while t > 0
msgbox x & " 的逆序數是: " & yend sub
求大佬們幫忙幾道vb的選擇題答案!謝謝 20
5樓:匿名使用者
14、vb6定義
變數,必須每個變數都要用 as 變數型別來定義,如果定義變數時某個變數後沒有as 變數型別,則它是變體變數,本題答案b
16、-2 to 2 是-2,-1,0,1,2五個,0 to 3是0,1,2,3四個,5*4=20,也就是答案a
17、int()和fix()都是取整函式,不同點在於負數是向上取整,還是向下取整,本題沒有負數,
所以int()和fix()是一樣的,3.3-3+4=4.3,也就是答案c
求一個vb大佬,**等,急急急急
6樓:聽不清啊
private sub ***mand1_click()dim n as integer, y as integern = inputbox("請輸入已知是幾進位制數:")s = inputbox("請輸入這個數:")for i = 1 to len(s)
c = mid(s, i, 1)
if c >= "0" and c <= mid("123456789", i, 1) then
y = y * n + asc(c) - 48else
msgbox (n & "進位制數中不可能有" & c & "!")exit sub
end if
next i
msgbox ("(" & s & ")" & n & "=" & y)
end sub
7樓:可道者
有的,我有這個,噠,感興趣的話可以看點我頭象~……瞭解一下
求vb大佬看看這哥問題如何解決 謝謝!!
8樓:匿名使用者
public function jiecheng(byval n as integer) as integer
dim jc as integer = 1
for i = 1 to n
jc = jc * i
next
return jc
end function
public function jiecheng(byval n as integer) as double
dim jc as double
jc = 1
for i = 1 to n
jc = jc * i
next
jiecheng = jc
end function
private function factorial1(intn as integer) as integer
'採用遞迴計算階乘
if intn = 0 then
factorial1 = 1
else
factorial1 = factorial1(intn - 1) * intn
end if
end function
給你幾個階乘的函式,你可以直接呼叫階乘的函式去做哦
9樓:匿名使用者
option explicit
private sub ***mand1_click()
dim m as double, n as double
inputdata m, "m"
inputdata n, "n"
if m < n then
print "***bination(" & m & "," & n; ")=" & 0
else
print "***bination(" & m & "," & n; ")=" & factorial(m) / (factorial(n) * factorial(m - n))
end if
end sub
public sub inputdata(byref t, byval char as string)
t = inputbox(char + "=", "輸入框", 25)
if int(val(t)) <> val(t) or val(t) < 0 then
msgbox "資料錯誤!
請重新輸入:", 16
inputdata t, char
end if
end sub
public function factorial(byval r)
dim i as integer
factorial = 1
for i = 1 to r
factorial = factorial * i
next i
end function
一道VB題,跪求答案,一道VB題,跪求答案
i don t know i don t know i don t know i don t know i don t know i don t know i don t know i don t know i don t know i don t know i don t know i don t...
一道vb題目,求大神幫忙,急一道vb題目,求大神幫忙!
這個彎路繞大了,36!3.71993e 41,是個億億億億億級的數字,vb中沒有什麼資料型別能精確存放它的結果,而36 7 36 7 只需要算 36 35 34 33 32 31 30 1 2 3 4 5 6 7 就行了。記住你了,以後再也不會鳥你的問題了,回答我也刪除掉 急求一道vb程式設計題答案...
求最後一道題的答案,求一道題答案
因為x是線段ab上的動點,所以,1 x 1 所以,x 1 0 x 1 x 1x 1 0 x 1 1 xx 4 0 x 4 4 x所以,x 1 x 1 2 x 4 x 1 1 x 2 4 x 8 x 1 x 1 2 x 4 8 分析 x a 1時,原式 8 x 0時,原式 8 x b 1時,原式 8 ...