Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

listenbox und textbox

Empfohlene Antworten

Hallo,

ich hoffe jemand kann mir helfen da ich ein Anfänger bin.

Ich habe eine Listenbox in der ca 30 Jpg Namen stehen die ich aus einem Verzeichnis einlesen habe.

In eine Textbox gebe ich ein jpg Namen eine nun möchte ich das eine Überprüfung zwischen der

listenbox und dem inhalt der textbox stattfindet falls der eingegebene Name nicht in der Listenbox sich befindet soll eine Fehlermeldung angezeigt werden

hoffentlich kann mir jemand helfen da ich es seit stunden bereits versuche (((

hier ist das was ich hingekriegt habe leider geht es nur mit Zahlen

Dim Artikel As String

Artikel = 1

If Single.TryParse(TextBox1.Text, Artikel) = False Then

MessageBox.Show("Artikel Nr: " & TextBox1.Text & " existiert nicht!! Bitte neu eingeben")

TextBox1.Text = ""

End If

PictureBox1.Image = Nothing

TextBox2.Text = Artikel

If TextBox1.Text = Artikel Then

PictureBox1.Image = Image.FromFile("C:\bilder\" & Artikel & ".jpg")

TextBox1.Text = ""

TextBox2.Text = Artikel

End If

End Sub

Hallöchen,

also du brauchst im Prinzip ja eine einfache Suche. Zum Bleistift sowas:

Dim i As Integer

      Dim wasGefunden As Boolean


      For i = 0 To listeMitDateien.ListCount - 1

            If InStr(1, listeMitDateien.List(i), txtSuchwort.Text) = 0 _

                  Or txtSuchwort.Text <> listeMitDateien.List(i) Then

                  wasGefunden = False

            Else

                  wasGefunden = True

                  Exit For

            End If

      Next


      If Not wasGefunden Then

            MsgBox "Datei nicht in Liste gefunden"

      Else

            MsgBox "Datei gefunden"

      End If

Damit sollte dein Problem dann auch gelöst sein. Der andere Teil sieht ok aus.

Gruß,

~Raphael

danke für deine antwort

leider bin ich zu blöd

listeMitDateien

txtSuchwort

Hm?

Also 'listeMitDateien' ist eine Listbox und 'txtSuchwort' ist die Textbox. einfach deine Objektnamen verwenden.

Gruß,

~Raphael

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.