Slide Show
Imports System.threading Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents ListBox1 As System.Windows.Forms.ListBox Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button3 As System.Windows.Forms.Button Friend WithEvents Button4 As System.Windows.Forms.Button Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel Private Sub InitializeComponent() Me.PictureBox1 = New System.Windows.Forms.PictureBox Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.ListBox1 = New System.Windows.Forms.ListBox Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.TextBox1 = New System.Windows.Forms.TextBox Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.Button3 = New System.Windows.Forms.Button Me.Button4 = New System.Windows.Forms.Button Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog Me.LinkLabel1 = New System.Windows.Forms.LinkLabel Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.PictureBox1.Location = New System.Drawing.Point(192, 136) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(176, 160) Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'GroupBox1 ' Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.GroupBox1.Location = New System.Drawing.Point(184, 112) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(192, 192) Me.GroupBox1.TabIndex = 1 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Preview" ' 'ListBox1 ' Me.ListBox1.ItemHeight = 19 Me.ListBox1.Location = New System.Drawing.Point(24, 136) Me.ListBox1.Name = "ListBox1" Me.ListBox1.Size = New System.Drawing.Size(136, 156) Me.ListBox1.TabIndex = 2 ' 'GroupBox2 ' Me.GroupBox2.Location = New System.Drawing.Point(16, 112) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(152, 192) Me.GroupBox2.TabIndex = 3 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "ImageList" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(16, 40) Me.TextBox1.Name = "TextBox1" Me.TextBox1.ReadOnly = True Me.TextBox1.Size = New System.Drawing.Size(216, 26) Me.TextBox1.TabIndex = 4 Me.TextBox1.Text = "" ' 'Button1 ' Me.Button1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte)) Me.Button1.ForeColor = System.Drawing.SystemColors.ControlText Me.Button1.Location = New System.Drawing.Point(248, 40) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(88, 24) Me.Button1.TabIndex = 5 Me.Button1.Text = "Browse.." ' 'Button2 ' Me.Button2.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte)) Me.Button2.ForeColor = System.Drawing.SystemColors.ControlText Me.Button2.Location = New System.Drawing.Point(136, 80) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(112, 24) Me.Button2.TabIndex = 6 Me.Button2.Text = "AddToList" ' 'Button3 ' Me.Button3.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte)) Me.Button3.ForeColor = System.Drawing.SystemColors.ControlText Me.Button3.Location = New System.Drawing.Point(88, 320) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(112, 24) Me.Button3.TabIndex = 7 Me.Button3.Text = "SlideShow" ' 'Button4 ' Me.Button4.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte)) Me.Button4.ForeColor = System.Drawing.SystemColors.ControlText Me.Button4.Location = New System.Drawing.Point(216, 320) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(64, 24) Me.Button4.TabIndex = 8 Me.Button4.Text = "Exit" ' 'LinkLabel1 ' Me.LinkLabel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.LinkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.Popup Me.LinkLabel1.Location = New System.Drawing.Point(136, 360) Me.LinkLabel1.Name = "LinkLabel1" Me.LinkLabel1.Size = New System.Drawing.Size(136, 24) Me.LinkLabel1.TabIndex = 9 Me.LinkLabel1.TabStop = True Me.LinkLabel1.Text = "By Desing Raja" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(8, 19) Me.BackColor = System.Drawing.Color.LightCoral Me.ClientSize = New System.Drawing.Size(382, 388) Me.Controls.Add(Me.LinkLabel1) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.GroupBox2) Me.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ForeColor = System.Drawing.SystemColors.ControlLightLight Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "Form1" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Slide Show DesingRaja(9840506718)" Me.ResumeLayout(False) End Sub #End Region Dim bn As Boolean Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OpenFileDialog1.Multiselect = False OpenFileDialog1.Filter = "Jpeg'*.jpg'Gif'*.gif'Jpeg'*.jpeg'Bitmap'*.bmp" OpenFileDialog1.RestoreDirectory = True OpenFileDialog1.Title = "Browse" If OpenFileDialog1.ShowDialog <> DialogResult.Cancel Then TextBox1.Text = OpenFileDialog1.FileName End If End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox1.Image = Image.FromFile(TextBox1.Text) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If TextBox1.TextLength <= 0 Then MessageBox.Show("PleaseSelect a file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button3) Exit Sub End If ListBox1.Items.Add(TextBox1.Text) End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged PictureBox1.Image = Image.FromFile(ListBox1.SelectedItem) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Application.Exit() End Sub Sub shows() Dim k, s As String Dim i, j, m As Integer For i = 0 To ListBox1.Items.Count - 1 k = ListBox1.Items.Item(i) s = k pb1.Image = Image.FromFile(s) Thread.Sleep(3000) Next Exit Sub End Sub Dim pb1 As New PictureBox Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If ListBox1.Items.Count = 0 Then MessageBox.Show("Please insert atleast one image", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button3) Button1.Focus() Exit Sub End If Dim crux As New Form crux.WindowState = FormWindowState.Maximized crux.Size = New Size(20, 20) crux.MaximizeBox = False crux.MinimizeBox = False crux.BackColor = Color.Black crux.Text = "Dilip's SlideShowMaker" pb1.Dock = DockStyle.Fill pb1.BackColor = Color.Black pb1.Size = New Size(30, 30) pb1.SizeMode = PictureBoxSizeMode.StretchImage pb1.BorderStyle = BorderStyle.Fixed3D crux.Controls.Add(pb1) crux.Show() Me.Hide() Dim cbz As New Thread(AddressOf shows) cbz.Start() End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked System.Diagnostics.Process.Start("mailto:desingraja_btech07@yahoo.co.in") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load bn = False End Sub Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click End Sub End Class