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.

[VB.NET] PictureBox

Empfohlene Antworten

Hallo zusammen,

Wie kann ich die PictureBox dazu bewegen ein Bild aus einem Verzeichnis zu laden.

Ich habe zwei Felder und ein Verzeichnis Bilder wo das Bild hinterlegt ist. 'Feldinhalt'.jpg

Nur wie bewege ich nun meine PictureBox das Bild zu laden.

    Function Bild_laden() As String


        Dim Path As String

        If MabonNrTextBox.Text <> "" Then

            Path = "C:\Produktbilder\" & MabonNrTextBox.Text & ".JPG"

        ElseIf MawisNrTextBox.TabStop > 0 Then

            Path = "C:\Produktbilder\" & MawisNrTextBox.Text & ".JPG"

        Else

            Path = "C:\Produktbilder\default.JPG"

        End If


        Return "Path"

    End Function


    Private Sub Kanban_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'TODO: Diese Codezeile lädt Daten in die Tabelle "KanbanDatenDataSet.Ersatzteile". Sie können sie bei Bedarf verschieben oder entfernen.

        Me.ErsatzteileTableAdapter.Fill(Me.KanbanDatenDataSet.Ersatzteile)


        PictureBox.ImageLocation = Bild_laden()


    End Sub

Nur das Funktioniert leider nicht so wie ich es mir erhoft habe.

Kann mir vielleicht jemand einen Tipp geben ?!

Bearbeitet von Lämmchen

auf die schnelle:

Image.FromFile Method (System.Drawing)

s'Amstel

Danke, hat geklappt :uli

        PictureBox.Image = Image.FromFile(Path)

        PictureBox.InitialImage = Image.FromFile(Path)

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.