use string variable to load image in picturebox

User avatar
sal21
PlatinumLounger
Posts: 4355
Joined: 26 Apr 2010, 17:36

use string variable to load image in picturebox

Post by sal21 »

Set Picture1.Picture = LoadPicture("C:\MIADIR\File.png")

Instead File.png, i need to set a variable name of image...

admit i have a string var:

nomefile="File2.png"

used this but have error
Set Picture1.Picture = LoadPicture("C:\MIADIR\"& nomefile &")"

User avatar
HansV
Administrator
Posts: 78465
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: use string variable top load image in pèiocturebox

Post by HansV »

Set Picture1.Picture = LoadPicture("C:\MIADIR\" & nomefile)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4355
Joined: 26 Apr 2010, 17:36

Re: use string variable top load image in pèiocturebox

Post by sal21 »

HansV wrote:
18 Oct 2022, 18:00
Set Picture1.Picture = LoadPicture("C:\MIADIR\" & nomefile)
:clapping: