Help!

PC-Problemen?
De vrijwilligers van Oplossing.be zoeken gratis met u mee!

Hulp bij posten

Recente topics

Auteur Topic: PictureBox en FileListBox koppelen  (gelezen 2743 keer)

0 leden en 1 gast bekijken dit topic.

Offline wouter1995

  • Oplosser
  • ****
  • Berichten: 717
  • Geslacht: Man
PictureBox en FileListBox koppelen
« Gepost op: 20 juni 2008, 12:50:47 »
De titel spreekt voor zich  :)

Als een gebruiker een file (afbeelding) aanklikt in de filelistbox is het de bedoeling dat die dan in de PictureBox wordt weergeven.

VB 2008 Xpress.

Bedankt !
Windows Vista H Premium SP2, XP Home/Pro SP3, 7 Professional, 2K Prof, Ubuntu 9.10, Server 2K3 R2 &2K8 R2 Enterprise, Win 98 SE, MSE, ASUS P7P55D-E, Core i5 760 @ 3,76 GHz, CoolerMaster 212, Kingston 4GB DDR3, Geforce 8500 GT, Velociraptor 150GB +Caviar Blue 500 GB,  2x DVD-RW, WLan 802.11G, PSU 550

Offline dizzl

  • Ambassadeur
  • *****
  • Berichten: 2.346
  • I've Upped my standards,now,up yours!
Re: PictureBox en FileListBox koppelen
« Reactie #1 Gepost op: 20 juni 2008, 19:49:42 »
zet een picturebox (PictureBox1) op je scherm en een knop(button1)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim FileDialog1 As New OpenFileDialog
        FileDialog1.ShowDialog()
        Dim vFileName As String
        'haal de naam van het bestand op
        vFileName = FileDialog1.FileName
        'laat de picturbox het bestand bevatten
        PictureBox1.ImageLocation = vFileName
    End Sub
Systeem  : Intel Core i5-4440 3.1Ghz, 3.1GHz 16Giga Ram 64Bits
Software : Windows 10 professional, Avira, Office 2016 Professional

Offline wouter1995

  • Oplosser
  • ****
  • Berichten: 717
  • Geslacht: Man
Re: PictureBox en FileListBox koppelen
« Reactie #2 Gepost op: 24 juni 2008, 15:17:35 »
Bedank ! Het werkt  ;D

Maar is er ook een manier om een bestand van rechtsreeks in de FileListBox te openen ?
Windows Vista H Premium SP2, XP Home/Pro SP3, 7 Professional, 2K Prof, Ubuntu 9.10, Server 2K3 R2 &2K8 R2 Enterprise, Win 98 SE, MSE, ASUS P7P55D-E, Core i5 760 @ 3,76 GHz, CoolerMaster 212, Kingston 4GB DDR3, Geforce 8500 GT, Velociraptor 150GB +Caviar Blue 500 GB,  2x DVD-RW, WLan 802.11G, PSU 550

Offline dizzl

  • Ambassadeur
  • *****
  • Berichten: 2.346
  • I've Upped my standards,now,up yours!
Re: PictureBox en FileListBox koppelen
« Reactie #3 Gepost op: 24 juni 2008, 16:49:19 »
'k snap de vraag niet
Systeem  : Intel Core i5-4440 3.1Ghz, 3.1GHz 16Giga Ram 64Bits
Software : Windows 10 professional, Avira, Office 2016 Professional

Offline AsinuS

  • Ervaren lid
  • ***
  • Berichten: 309
  • odi et amo
Re: PictureBox en FileListBox koppelen
« Reactie #4 Gepost op: 24 juni 2008, 21:32:03 »
'k snap de vraag niet

ik ook niet, maar misschien bedoelt hij een bestand in de picture box laden zonder de filedialog ;)

zet een breakpunt op de lijn hieronder, kijk wat er in FileName zit
vFileName = FileDialog1.FileName
verander dat door het bestand dat je rechtstreeks wil laden
Dim sBestand as String = "nieuw path enzo van uw bestand"
'laat de picturbox het bestand bevatten
PictureBox1.ImageLocation = sBestand
A7N8X2.0 ASUSTeK Computer INC., ATI display adapter AGP (0x4A54)ATI display adapter AGP (0x4A54), Windows XP, Prof, SP2, NL, AMD Athlon(tm), 1024 MB RAM, HDD:20 + 156 + 293 + 245 + 244 GB, NTFS, AVG antivirus, Microsoft Outlook

Offline wouter1995

  • Oplosser
  • ****
  • Berichten: 717
  • Geslacht: Man
Re: PictureBox en FileListBox koppelen
« Reactie #5 Gepost op: 27 juni 2008, 18:57:14 »
Idd.

De gebruiker selecteert een bestand in de FileLstbx en komt dan rechtstreeks in de PictureBox zonder de FileDialog.

Als ik deze code vFileName =
FileDialog1.FileName
invoer, krijg ik de error Declaration Expected.

Wat is dat en hoe los ik het op ?

Windows Vista H Premium SP2, XP Home/Pro SP3, 7 Professional, 2K Prof, Ubuntu 9.10, Server 2K3 R2 &2K8 R2 Enterprise, Win 98 SE, MSE, ASUS P7P55D-E, Core i5 760 @ 3,76 GHz, CoolerMaster 212, Kingston 4GB DDR3, Geforce 8500 GT, Velociraptor 150GB +Caviar Blue 500 GB,  2x DVD-RW, WLan 802.11G, PSU 550

 


www.combell.com