Zebra0.com

visual-basic examplesProfessor Joy: CMSC222 Class Work

Professor Joy: CMSC222 Class Work

ListBox and Data

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'EmployeeDataSet.tblEmployee' table. You can move, or remove it, as needed.
        Me.TblEmployeeTableAdapter.Fill(Me.EmployeeDataSet.tblEmployee)
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        Me.Text = ListBox1.Text
        Dim file As String = "C:\mypictures\" & ListBox1.Text & ".jpg"
        On Error Resume Next
        Me.PictureBox1.Load(file)
    End Sub
End ClassEnd Class

This web site, and all pages therein, are the sole property and responsibility of Zebra0.com.
It is not endorsed, sponsored, or provided by or on behalf of Montgomery College.