-
Hello People,
I have a listbox which shows 5 items(strings).
Those 5 items are pictures.
When a user clicks on one of those items, I want the frmmain.picture to become that picture.
example.
Code:
lstwallpaper.additem"Clouds"
lstwallpaper.additem"Moon"
lstwallpaper.additem"Lakes"
lstwallpaper.additem"Sun"
lstwallpaper.additem"Win2000"
now when a user clicks on one of those I would like the form to take on that background.
Here is what I have tried.
Code:
dim x%
dim picture$
picture$ = lstwallpaper.list(x%)
frmmain.picture= picture$
Thanks in advance
-
<?>
'here's a start for you
'remember your picture should be the size of your form
'or you will have to tile it
Code:
Private Sub Command1_Click()
List1.AddItem "C:\windows\waves.bmp"
End Sub
Private Sub List1_Click()
Set Form1.Picture = LoadPicture(List1.Text)
End Sub
-
<?>
In case you were wondering how to tile an image.
Code:
'tile an image on a form
'1) Place an image control on a form and give it a picture
'2) Set the forms AutoRedraw to False
'3) Place this code in the Form Paint Event
Dim intX As Integer
Dim intY As Integer
For intX = 0 To myForm.Width Step Image1.Width
For intY = 0 To myForm.Height Step Image1.Height
PaintPicture Image1, intX, intY
Next intY
Next intX