Slideshow In VB.net
Imports System.IO
Public Class SlideShow
Dim c As String
Dim i As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As String
Dim b As String = "\bin\Debug"
a = Directory.GetCurrentDirectory
c = Replace(a, b, "")
ComboBox1.Items.Add("1")
ComboBox1.Items.Add("2")
ComboBox1.Items.Add("3")
ComboBox1.Items.Add("5")
ComboBox1.Items.Add("10")
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
PictureBox1.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
TextBox2.Text = ListBox1.SelectedIndex
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Me.WindowState = FormWindowState.Maximized
'PictureBox1.Size = Me.Size
i = ListBox1.Items.Count
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim k As Integer
If TextBox2.Text = "" Then
i = 0
Else
i = TextBox2.Text
End If
If ListBox1.Items.Count <> 0 Then
While i <= ListBox1.Items.Count - 1
i = i + 1
If i = ListBox1.Items.Count Then
i = 0
End If
ListBox1.SelectedIndex = i
PictureBox1.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
PictureBox2.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
Exit Sub
End While
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.WindowState = FormWindowState.Maximized
PictureBox2.Visible = True
PictureBox2.Height = 683
PictureBox2.Width = 1019
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Timer1.Enabled = False
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Timer1.Enabled = True
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
PictureBox2.Visible = False
PictureBox2.Height = 10
PictureBox2.Width = 50
Me.WindowState = FormWindowState.Normal
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyFolderBrowser As New System.Windows.Forms.FolderBrowserDialog
MyFolderBrowser.Description = "Please Select the Folder Containing Database Files"
MyFolderBrowser.RootFolder = Environment.SpecialFolder.MyComputer
Dim dlgResult As DialogResult = MyFolderBrowser.ShowDialog()
If dlgResult = Windows.Forms.DialogResult.OK Then
TextBox1.Text = MyFolderBrowser.SelectedPath
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Clear()
Dim di As New IO.DirectoryInfo(TextBox1.Text)
Dim diar1 As IO.FileInfo() = di.GetFiles()
Dim dra As IO.FileInfo
Dim count As Integer = 0
For Each dra In diar1
ListBox1.Items.Add(dra)
count = count + 1
Next
TextBox3.Text = count
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer1.Enabled = False
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Timer1.Enabled = True
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Timer1.Interval = Val(ComboBox1.Text) * 1000
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
ListBox1.Items.Clear()
End Sub
End Class
Imports System.IO
Public Class SlideShow
Dim c As String
Dim i As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As String
Dim b As String = "\bin\Debug"
a = Directory.GetCurrentDirectory
c = Replace(a, b, "")
ComboBox1.Items.Add("1")
ComboBox1.Items.Add("2")
ComboBox1.Items.Add("3")
ComboBox1.Items.Add("5")
ComboBox1.Items.Add("10")
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
PictureBox1.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
TextBox2.Text = ListBox1.SelectedIndex
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Me.WindowState = FormWindowState.Maximized
'PictureBox1.Size = Me.Size
i = ListBox1.Items.Count
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim k As Integer
If TextBox2.Text = "" Then
i = 0
Else
i = TextBox2.Text
End If
If ListBox1.Items.Count <> 0 Then
While i <= ListBox1.Items.Count - 1
i = i + 1
If i = ListBox1.Items.Count Then
i = 0
End If
ListBox1.SelectedIndex = i
PictureBox1.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
PictureBox2.ImageLocation = TextBox1.Text & "\" & ListBox1.Text
Exit Sub
End While
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.WindowState = FormWindowState.Maximized
PictureBox2.Visible = True
PictureBox2.Height = 683
PictureBox2.Width = 1019
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Timer1.Enabled = False
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Timer1.Enabled = True
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
PictureBox2.Visible = False
PictureBox2.Height = 10
PictureBox2.Width = 50
Me.WindowState = FormWindowState.Normal
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyFolderBrowser As New System.Windows.Forms.FolderBrowserDialog
MyFolderBrowser.Description = "Please Select the Folder Containing Database Files"
MyFolderBrowser.RootFolder = Environment.SpecialFolder.MyComputer
Dim dlgResult As DialogResult = MyFolderBrowser.ShowDialog()
If dlgResult = Windows.Forms.DialogResult.OK Then
TextBox1.Text = MyFolderBrowser.SelectedPath
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Clear()
Dim di As New IO.DirectoryInfo(TextBox1.Text)
Dim diar1 As IO.FileInfo() = di.GetFiles()
Dim dra As IO.FileInfo
Dim count As Integer = 0
For Each dra In diar1
ListBox1.Items.Add(dra)
count = count + 1
Next
TextBox3.Text = count
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer1.Enabled = False
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Timer1.Enabled = True
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Timer1.Interval = Val(ComboBox1.Text) * 1000
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
ListBox1.Items.Clear()
End Sub
End Class
No comments:
Post a Comment