English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

Private Sub Form_Load()
For i = 1 To 9
For j = 1 To 9
bcc = i*j
Label1.Caption = bcc
Next j

Next i


End Sub

我寫了這樣
我想讓它顯示1*1 1*2 ...9*8..9*9的答案都顯示出來
讓這些答案都顯示在LABEL1 有誰能幫我看看程式碼哪邊了麼

2007-01-06 11:50:07 · 1 個解答 · 發問者 ? 1 in 電腦與網際網路 程式設計

可以幫忙解釋最後兩段的意思麼??

2007-01-07 02:45:33 · update #1

Mid$(bcc, Len(bcc) - 1) = vbCrLf
Next
Label1.Caption = bcc
Label1.AutoSize = True
Label1.WordWrap = True
這邊都幫我解釋一下 好麼 我真的看不懂

2007-01-07 02:46:38 · update #2

1 個解答

Private Sub Form_Load()
Dim I%, J%, bcc As String


For I = 1 To 9
For J = 1 To 9
bcc = bcc & I & "*" & J & "=" & I * J & " "
Next
Mid$(bcc, Len(bcc) - 1) = vbCrLf
Next
Label1.Caption = bcc
Label1.AutoSize = True
Label1.WordWrap = True
End Sub

2007-01-07 14:02:23 補充:
因為每跑一次For J = 1 To 9,bcc這字串最後2字一定是空格,
Mid$(bcc, Len(bcc) - 1) = vbCrLf 就是把2個空格改成VbCrLf換行字元,
但若沒把Label1.AutoSize設成True,Label1就不會自動變化大小來配合字串,Label1.WordWrapa沒設成True,就算有bcc換行字元Label1也不會換行,還是只有一行很長的排下企.

2007-01-06 12:45:49 · answer #1 · answered by W.J.S. 7 · 0 0

fedest.com, questions and answers