vb.net实现多图片自定义显示
UI
图片框1
计时器1
按钮1
文本框1
Imports unity3d 是VB.NET使用nity3d制作调用3D时使用用的可以去
代码如下
Imports unity3d
Public Class Form1
Dim Nom As Integer '自动更换图片的名称
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
TextBox1.Text = 1
Button1.Text = "播放"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click '按一下更新一下张
With Timer1
.Interval = TextBox1.Text
If .Enabled = True Then
.Enabled = False
Button1.Text = "播放"
Else
.Enabled = True
Button1.Text = "停止"
End If
End With
'Nom += 1
'For i = 1 To 2
' Dim 名称 As String = String.Format("C:\Users\wangh\Pictures\{0}.png", Nom) '会返回duImg1.png,Img2.png...
' PictureBox1.Image = Bitmap.FromFile(名称)
'Next
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Nom += 1
If Nom > 9 Then Nom = 1
For i = 1 To 2
Dim mane As String = String.Format("C:\Users\wangh\Pictures\{0}.png", Nom) '会返回duImg1.png,Img2.png...
PictureBox1.Image = Bitmap.FromFile(mane)
Next
End Sub
End Class