Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

VB.NET Add only one picture

$
0
0

I have picture brower but open whole folder and I want to make something that open only one specyfic file wiht have name "W". I do not have idea what can I change that it will be work.

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Dim cboItems As New List(Of String)
        ' Dim sb As New StringBuilder
        Dim z As String
        Dim w As String
        Dim currentCountry = CType(SamochodyBindingSource.Current, DataRowView).Row.Field(Of String)("Model")
        z = cbxMarka.Text
        SamochodyDataSet0.Samochody.Where(Function(row) row.Marka = z).Select(Function(row) row.Identyfikator).ToList().ForEach(Sub(Identyfikator) cboItems.Add(Identyfikator))
        ComboBox2.DataSource = cboItems
        w = ComboBox2.Text
        MsgBox(w)


        Dim dlgOtworz As New FolderBrowserDialog
        dlgOtworz.ShowNewFolderButton = False
        lbxPliki.Items.Clear()
        Me.Text = "Przeglądarka"
        If dlgOtworz.ShowDialog = DialogResult.OK Then
            Folder = dlgOtworz.SelectedPath
            Dim plik As FileInfo
            Dim katalog As New DirectoryInfo(dlgOtworz.SelectedPath)
            listaP = katalog.GetFiles("*.jpg")
            If listaP.Length < 1 Then
                MessageBox.Show("W wybranym folderze brak JPG", "Uwaga", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Else
                For Each plik In listaP
                    lbxPliki.Items.Add(plik.Name)
                Next
            End If
        End If
    End Sub


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>