利用vb程式設計設計類似於windows附件中的計算器程

2022-02-21 16:41:57 字數 2552 閱讀 9078

1樓:

我有現成的,老外編的,想要就留個郵箱,但是不要提問題。

2樓:匿名使用者

sub op()

t1.enabled = true

t1.visible = true

t1.setfocus

end sub

sub oi()

t1.enabled = false

t1.visible = false

end sub

private sub command1_click()if o1 then

t5 = t1 + t3

elseif o2 then

t5 = t1 - t3

elseif o3 then

t5 = t1 * t3

elseif o4 then

if t3 = 0 then

msgbox "除數不能為零"

t3 = ""

t3.setfocus

else

t5 = t1 / t3

end if

elseif o5 then

t5 = sin(t3 * 3.141592653 / 180)elseif o6 then

t5 = cos(t3 * 3.141592653 / 180)elseif o7 then

t5 = tan(t3 * 3.141592653 / 180)elseif o8 then

t5 = 1 / tan(t3 * 3.141592653 / 180)

elseif o9 then

if t3 < 0 then

msgbox "被開方數不能小於零", 2 + vbexclamation, "錯誤"

t3 = ""

t3.setfocus

exit sub

end if

t5 = sqr(t3)

elseif o10 then

t5 = abs(t3)

elseif o11 then

t5 = exp(t3)

elseif o12 then

if t3 <= 0 then

t3 = ""

t3.setfocus

end if

t5 = log(t3)

end if

end sub

private sub form_load()height = screen.heightwidth = screen.width

move 0, 0

end sub

private sub o1_click()call op

t2 = o1.caption

end sub

private sub o10_click()call oi

t2 = o10.caption

t3.setfocus

end sub

private sub o11_click()call oi

t2 = o11.caption

t3.setfocus

end sub

private sub o12_click()call oi

t2 = o12.caption

t3.setfocus

end sub

private sub o2_click()call op

t2 = o2.caption

end sub

private sub o3_click()call op

t2 = o3.caption

end sub

private sub o4_click()call op

t2 = o4.caption

end sub

private sub o5_click()call oi

t2 = o5.caption

t3.setfocus

end sub

private sub o6_click()call oi

t2 = o6.caption

t3.setfocus

end sub

private sub o7_click()call oi

t2 = o7.caption

t3.setfocus

end sub

private sub o8_click()call oi

t2 = o8.caption

t3.setfocus

end sub

private sub o9_click()call oi

t2 = o9.caption

t3.setfocus

end sub

private sub t2_change()t1 = ""

t5 = ""

t3 = ""

end sub

o1,o2,,,,,,,o12都是單選按鈕,分別對應不同的計算符號 + - * / sin cos tan cot sqr abs exp log ,t1,,,,t5是文字框

c 程式設計,設計簡單的程式,c 程式設計,設計一個簡單的程式

include using namespace std int main int b 1 相當於int b 1 int p a int t1 0 t2 0 從第一個元素開始遍歷陣列 for int i 0 i 20 else if i 1 20 當本次搜尋第一個元素與b不相等時,並且當該元素不是倒數...

vb程式設計題設計程式求VB程式設計題設計程式求s1234n1n的值並輸出,其中n是從鍵盤輸入大於1的正整數

照樓主的題目,n不是大於1的正整數,應該是大於回1的正偶數才對答吧?private sub mand1 click n val inputbox n if n mod 2 1 then exit subt 1 2 s t for i 3 to n 1 step 2t t i i 1 i 1 i 1 ...

vb程式設計check選擇設計

private sub command1 click dim s as string if check1.value vbchecked thens check1.caption end if if check2.value vbchecked thens s check2.captionend i...