Pages

Tuesday, August 23, 2016

vb.net Code in DataGridView Arranging Columns

vb.net Code in  DataGridView Arranging Columns


In DataGridView1 are 8 columns, Start at '0' in first column 

    DataGridView1.Columns(0).Width = 40
        DataGridView1.Columns(1).Width = 60
        DataGridView1.Columns(2).Width = 100
        DataGridView1.Columns(3).Width = 120
        DataGridView1.Columns(4).Width = 107
        DataGridView1.Columns(5).Width = 90
        DataGridView1.Columns(6).Width = 60
        iDataGridView1.Columns(7).Width = 60

 vb.net How to backup database file in a specific location


Public Class frmbackup
    Dim a, b As String

    Private Sub frmbackup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtpath.ReadOnly = True
        a = Application.StartupPath
    End Sub


    Private Sub btnbkup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbkup.Click
        Try
            If txtpath.Text = "" Then
                MsgBox("Please select path", MsgBoxStyle.Information, "Backup error")
            Else

                b = txtpath.Text
                FileCopy(a & "\data.mdb", b & "\" & Date.Today & ".mdb")
                MsgBox("Bakup successfully")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub btnslt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnslt.Click
        If fbd.ShowDialog() = DialogResult.OK Then
            txtpath.Text = fbd.SelectedPath
        End If
    End Sub

End Class



Thursday, September 12, 2013

Progress Bar using text box


'ProgressBar1 CODE
Private Sub Timer1_Timer()
If Not Text2.Width > Text1.Width Then
  Text2.Width = Text2.Width + 10
Else
  Exit Sub
End If
End Sub
'End of ProgressBar1 CODE