Harley2011
15-10-2015, 23:08
Имеется код с MVB 6 давайте переделаем на .Net
Вот код
Dim wirina As Integer, visota As Integer
Dim x As Integer, y As Integer
Private Sub Form_Load()
Timer1.Interval = 50
Picture2.AutoSize = True
Picture2.Picture = LoadPicture("с:\1.jpg")
wirina = Picture2.Width
visota = Picture2.Height
Picture1.Height = Picture2.Height
End Sub
Private Sub Timer1_Timer()
x = x + 40
Picture1.PaintPicture Picture2.Picture, -x, -y
If x + Picture1.ScaleWidth >= Picture2.ScaleWidth Then
Picture1.PaintPicture Picture2.Picture, -x + Picture2.ScaleWidth, -y
End If
If x >= Picture2.Width Then x = 0
End Sub
На форму будильник и два PictureBox
Вот код
Dim wirina As Integer, visota As Integer
Dim x As Integer, y As Integer
Private Sub Form_Load()
Timer1.Interval = 50
Picture2.AutoSize = True
Picture2.Picture = LoadPicture("с:\1.jpg")
wirina = Picture2.Width
visota = Picture2.Height
Picture1.Height = Picture2.Height
End Sub
Private Sub Timer1_Timer()
x = x + 40
Picture1.PaintPicture Picture2.Picture, -x, -y
If x + Picture1.ScaleWidth >= Picture2.ScaleWidth Then
Picture1.PaintPicture Picture2.Picture, -x + Picture2.ScaleWidth, -y
End If
If x >= Picture2.Width Then x = 0
End Sub
На форму будильник и два PictureBox