Re: [VB6 ] 請VB 高手幫幫小弟 請進裡面看
我是用VB2005
VB6不知同不同
Dim a, b, c, d As Integer
Dim f As Integer
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
Label1.Text = ""
For f = a To b Step c
d += f
If f = a Then
Label1.Text &= f
Else
Label1.Text &= "+" & f
End If
Next
Label1.Text &= "=" & d
慢慢研究 : )
※ 引述《plsy3310 (信任=謊言)》之銘言:
: 以下 是我的 程式碼 是一個迴圈
: Dim a, b, c, d As Integer
: Dim f As Integer
: a = TextBox1.Text
: b = TextBox2.Text
: c = TextBox3.Text
: For f = a To b Step c
: d += f
: Next
: Label1.Text = d
: 問題來了
: 假如 a =1 b=5 c=1
: 運算出來 d 會等於15
: label1 會顯示 15
: 但是 我想要 label1 顯示出 1+2+3...+5=15
: 那麼我 在該 label1後 面 寫什麼 請 高手 幫幫忙 謝謝
※ 編輯: humanfly 來自: 218.172.48.165 (10/13 23:58)
→
10/14 00:15, , 1F
10/14 00:15, 1F
討論串 (同標題文章)