私はVBが初めてです。私は本を読み、そのコードに従う
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim Wrap As String
Wrap = Chr(13) & Chr(10)
Dim i As Integer
For i = 1 To 4
PictureBox1.Image = System.Drawing.Image.FromFile("C:\face0" & i & ".ico")
MsgBox("Click for next face")
Next
End Sub
End Class
できます。ただし、コードを調整して、Wrap が form1 全体で使用できる変数になるようにします。私は次のことをしますが、うまくいきません。なんで?
Public Class Form1
Dim Wrap As String
Wrap = Chr(13) & Chr(10)
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 1 To 4
PictureBox1.Image = System.Drawing.Image.FromFile("C:\face0" & i & ".ico")
MsgBox("Click for next face")
Next
End Sub
End Class