here is my code
Public Sub Personalize_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each fi As FileInfo In New DirectoryInfo(Application.StartupPath + "\web").GetFiles
Dim pictooltip As New ToolTip
Dim pbx As New Button
AddHandler pbx.Click, AddressOf pbx_click
pbx.Width = 150
pbx.Height = 150
pbx.BackgroundImage = Image.FromFile(fi.FullName)
wallpapers.Controls.Add(pbx)
pbx.Cursor = Cursors.Hand
pictooltip.SetToolTip(pbx, fi.Name)
pbx.BackgroundImageLayout = ImageLayout.Stretch
Next
End Sub
Private Sub pbx_click()
main.BackgroundImage = Image.FromFile(fi.FullName)
End Sub
i can't figure how to use "fi" in pbx_click()
any hint for that ??