Saturday, 12 September 2015

Hello Every one

We at Elite Software Solutions provide you the best unique codes snippets for all your needs
get your projects done in a week from experts.

OUR SERVICES ARE AS FOLLOWS

Web Designing
Web Promotion
.Net Developing(C#,Vb,ASP)
 
Facebook LIKES Sales (get 10K likes to your Facebook page in a single day at low prices)
Facebook group advertising- Get your product advertised in 1000's of groups
Blog Creations- 0.2 millions blogs and counting
Blog advertising.

and lastly the new way of getting noticed

Online Event Organisation
Online Event managing and promotion 

Contact us at
ss.sachin750@gmail.com


Start Your vb.net app from Windows Notification area

Start Your vb.net app from Windows Notification area


Imports System.Net.Mail
Public Class Form2
    Dim y As Integer
    Dim x As Integer
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Hide()
        Me.Notif.Visible = True
        draw()
        Me.ShowInTaskbar = False

        Timer3.Enabled = True
        Me.Hide()
        ' Timer1_Tick(Nothing, Nothing)
        Me.WindowState = FormWindowState.Minimized
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Show()
        Me.Top = Me.Top - 10
        If Me.Top < y - Me.Height Then
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        Timer2.Enabled = True
        'Hide()
        'Me.Notif.Visible = True
        'Me.ShowInTaskbar = False

        'Timer3.Enabled = True
        'Me.Hide()
        '' Timer1_Tick(Nothing, Nothing)
        'Me.WindowState = FormWindowState.Minimized
    End Sub

    Sub draw()
        Dim sx As Integer
        Dim sy As Integer
        sx = My.Computer.Screen.Bounds.Width
        sy = My.Computer.Screen.Bounds.Height
        x = sx - Me.Width
        y = sy - 0
        Me.Left = x - 0
        Me.Top = y
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Me.Top = Me.Top + 10
        Do Until Me.Top > 768
            Me.Top = Me.Top + 10
        Loop
        If Me.Top > y Then
            Timer2.Enabled = False
            ' Timer2.Enabled = True
        End If
        If Me.Top = 728 Then
            Timer2.Enabled = False
            Hide()
            Me.Top = 728
            Exit Sub
        End If
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

    Private Sub Notif_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Notif.MouseDoubleClick
        Timer1.Enabled = True
    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        Me.Show()
        Timer3.Enabled = False
        ' fhide()
        If Timer3.Enabled = False Then
            Timer1.Enabled = True
        End If
    End Sub
End Class

File watcher in vb.net

File watcher in vb.net
choose path and any changes to the drive like creation deletion of files will be recorded

Try it




Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FolderBrowserDialog1.ShowDialog()
        TextBox1.Text = FolderBrowserDialog1.SelectedPath
        FileSystemWatcher1.Path = TextBox1.Text
        MsgBox("Path to monitor is now set to: " & TextBox1.Text)
    End Sub
    Private Sub FileSystemWatcher1_Renamed(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Renamed
        ListBox1.Items.Add("File- " & e.FullPath.ToString & " renamed at: " & System.DateTime.Now)
    End Sub
    Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
        ListBox2.Items.Add("File- " & e.FullPath.ToString & " created at: " & System.DateTime.Now)
    End Sub
    Private Sub FileSystemWatcher1_Deleted(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Deleted
        ListBox3.Items.Add("File- " & e.FullPath.ToString & " deleted at: " & System.DateTime.Now)
    End Sub
    Private Sub FileSystemWatcher1_Changed(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed
        ListBox4.Items.Add("File- " & e.FullPath.ToString & " modified at: " & System.DateTime.Now)
    End Sub

End Class

Document/File Browser in vb.net

Document/File Browser in vb.net
Imports System.IO
Public Class Form25
    Dim k, k1 As String
    Private Sub Form25_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    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
            TextBox2.Text = MyFolderBrowser.SelectedPath
         
        End If


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim a As String
     
        ListBox1.Items.Clear()
        ListBox2.Items.Clear()
        ListBox3.Items.Clear()
        ListBox4.Items.Clear()
        Dim d As String = TextBox2.Text & "\"
        If System.IO.Directory.Exists(TextBox2.Text) Then
            For Each Dir As String In Directory.GetDirectories(TextBox2.Text)
                ListBox1.Items.Add(Replace(Dir, d, ""))
            Next

        Else
            MsgBox("Invalid Directory")
            TextBox2.Text = ""
            Exit Sub
        End If
     
        Dim di As New IO.DirectoryInfo(TextBox2.Text)
        Dim diar1 As IO.FileInfo() = di.GetFiles("*.*")

        Dim dra As IO.FileInfo

        Dim count = 0
        For Each dra In diar1
            ListBox2.Items.Add(dra)
            a = dra.Extension
            If a = ".mdf" Or a = ".LDF" Then
                ListBox4.Items.Add("Database Files")
            ElseIf a = ".docx" Or a = ".rtf" Then
                ListBox4.Items.Add("Word Files")
                ListBox3.Items.Add(dra)
            ElseIf a = ".xlsx" Then
                ListBox4.Items.Add("Speed Sheet Files")
                ListBox3.Items.Add(dra)
            ElseIf a = ".pdf" Or a = ".xps" Then
                ListBox4.Items.Add("Printing Files")
                ListBox3.Items.Add(dra)
            Else
                ListBox4.Items.Add("Other Files")
            End If
            count = count + 1
        Next

    End Sub

    Private Sub ListBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Click
        If TextBox2.Text.Length < 5 Then
            TextBox2.Text = Nothing
        End If
        If TextBox2.Text = Nothing Then
            TextBox2.Text = ListBox1.Text
        Else
            TextBox2.Text = TextBox2.Text & "\" & ListBox1.Text
        End If

    
    End Sub



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox2.Text = Nothing
    End Sub

 
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If TextBox2.Text.Length = 0 Then
            MsgBox("Search String is empty")
            Exit Sub
        End If
        k = StrReverse(TextBox2.Text)
        Dim test As String = k
        Dim slen As Integer = TextBox2.Text.Length
        Dim startPos As Integer = test.IndexOf("_") + 1
        Dim endPos As Integer = test.IndexOf("\", startPos)
        Dim result As String = test.Substring(startPos, endPos - startPos)
        k1 = "\" & StrReverse(result)
        If TextBox2.Text = "" Then
            MsgBox("please choose a directory to Search")
        Else
            ' TextBox2.Text = Replace(slen, endPos + 1, "")
            TextBox2.Text = Replace(TextBox2.Text, k1, "")
        End If
    End Sub
End Class

Windows similar Image Viewer and Image Mover in VB.NET

Windows similar Image Viewer and Image Mover in VB.NET



Code:(path image in Form Load must be changed to folder containing pictures)

Public Class Form20
    Dim a, b As Integer
    Private m_PanStartPoint As New Point

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Panel1.AutoScroll = True
        pb1.SizeMode = PictureBoxSizeMode.AutoSize
        ListBox1.Items.Clear()
        Dim di As New IO.DirectoryInfo(pathimage)
        Dim diar1 As IO.FileInfo() = di.GetFiles()
        Dim dra As IO.FileInfo
        Dim count = 0
        For Each dra In diar1
            ListBox1.Items.Add(dra)
            count = count + 1
        Next
        TextBox1.Text = count
    End Sub

    Private Sub pb1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pb1.MouseDown
        m_PanStartPoint = New Point(e.X, e.Y)
    End Sub

    Private Sub pb1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pb1.MouseMove
        If e.Button = Windows.Forms.MouseButtons.Left Then
            'Here we get the change in coordinates.
            'We multiply it by -1 because of how the panels autoscroll works.
            Dim DeltaX As Integer = (m_PanStartPoint.X - e.X)
            Dim DeltaY As Integer = (m_PanStartPoint.Y - e.Y)
            'Set the new autoscroll position.
            'ALWAYS pass positive integers to the panels autoScrollPosition method
            Panel1.AutoScrollPosition = New Drawing.Point((DeltaX - Panel1.AutoScrollPosition.X), (DeltaY - Panel1.AutoScrollPosition.Y))
        End If
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        pb1.ImageLocation = pathimage & "\" & ListBox1.Text
        PictureBox1.ImageLocation = pathimage & "\" & ListBox1.Text
    End Sub


  


    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage
    End Sub

    Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
        PictureBox1.SizeMode = PictureBoxSizeMode.Normal
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PictureBox1.Visible = True
        a = PictureBox1.Location.X
        b = PictureBox1.Location.Y
        pb1.Visible = False
        Panel1.Visible = False
        PictureBox1.Size = Panel1.Size
        PictureBox1.Location = Panel1.Location
        RadioButton1.Visible = True
        RadioButton2.Visible = True
        RadioButton3.Visible = True
        RadioButton4.Visible = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        pb1.Visible = True
        Panel1.Visible = True
        PictureBox1.Location = New Point(a, b)
        PictureBox1.Size = New Point(143, 12)
        PictureBox1.Visible = False
        RadioButton1.Visible = False
        RadioButton2.Visible = False
        RadioButton3.Visible = False
        RadioButton4.Visible = False
    End Sub
End Class

Slideshow In VB.net with time intervals

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


Read MS Word And Excel Files From Vb.net

Read MS Word And Excel Files From Vb.net

Copy and Paste the Code In the Code Window :

Imports Word = Microsoft.Office.Interop.Word
Imports System.Runtime.InteropServices
Imports System
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.OleDb
Public Class ImportDoc
    Dim MSWord As New Word.Application
    Dim WordDoc As New Word.Document
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.Title = "Please select a MicroSoft Word file"
        OpenFileDialog1.InitialDirectory = docpath
        OpenFileDialog1.Filter = "Word files (*.doc)|*.docx"
        If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            Dim wordFileName As String = OpenFileDialog1.FileName
            TextBox1.Text = wordFileName
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        OpenFileDialog1.FileName = TextBox1.Text
        With MSWord
            .Documents.Open(OpenFileDialog1.FileName)
            .Selection.WholeStory()
            .Selection.Copy()
            RichTextBox1.Paste()
            .Quit()
        End With
        MSWord = Nothing
    End Sub


    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        'Using f As New Form1
        'f.ShowDialog()
        ' f.Dispose()
        ' End Using
        Dim dt As New DataTable
        Dim OpenFileDialog1 As New OpenFileDialog
        Dim FileName As String = ""
        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            FileName = OpenFileDialog1.FileName.ToUpper
            Dim Builder As New OleDbConnectionStringBuilder With {.DataSource = FileName}
            TextBox1.Text = OpenFileDialog1.FileName
            OpenFileDialog1.Filter = "Excel files (*.xlsx)|*.xlsx"
            If IO.Path.GetExtension(FileName.ToUpper) = ".XLSX" Then
                Builder.Provider = "Microsoft.ACE.OLEDB.12.0"
                Builder.Add("Extended Properties", "Excel 12.0;HDR=No;")
            Else
                Builder.Provider = "Microsoft.Jet.OLEDB.4.0"
                Builder.Add("Extended Properties", "Excel 8.0;HDR=No;")
            End If
            Using cn As New OleDbConnection With {.ConnectionString = Builder.ConnectionString}
                Dim cmd As New OleDbCommand With _
                { _
                    .CommandText = "SELECT * FROM [Sheet1$]", _
                    .Connection = cn _
                }
                cn.Open()
                dt.Load(cmd.ExecuteReader)
            End Using
            DataGridView1.DataSource = Nothing
            If dt.Rows.Count > 0 Then
                DataGridView1.DataSource = dt
            Else
                MessageBox.Show(String.Format("Did not find any data in{0}{1}", Environment.NewLine, FileName))
            End If
        End If
    End Sub
  
 


    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        RichTextBox1.Visible = True
        DataGridView1.Visible = False
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        RichTextBox1.Visible = False
        DataGridView1.Visible = True
    End Sub
End Class