 |
|
 |
Thyrosis Level: Trainee
 Registered: 10-11-2005 Posts: 3
|
recalling image
Hello everybody,
I just spend the whole morning and half the afternoon searching the internet and this forum to something I still haven't found, and my final solution was signing up and just asking.
The thing is: I want to create something like a roll-over image in html, but then in vb.net (2003). By hovering the mouse over 3 different buttons, a image should appear next to them buttons and show 3 different images (according to the buttons ofcourse).
What I did is:
put the images in an imagelist;
create 1 picturebox;
create 3 buttons;
| Private Sub btn1_MouseHover |
and then?
I thought
| picBox1.image = imgList1(0) | (first picture is 0, like an array?)
But then I get the blue curvy lines beneath , telling me: "Class 'System.Windows.Forms.Imagelist' cannot be indexed because it has no default property."
What can I do to make it work?
Thanks in advance
Thyrosis
____________________________
Thyrosis
vb.Net student
desperately seeking for answers :p
|
|
10-11-2005 at 02:21 PM |
|
|
Thyrosis Level: Trainee
 Registered: 10-11-2005 Posts: 3
|
Re: recalling image
Thanks for the reply! I tried it, but gave several errors though.
- dotnet doesnt support Set and Let anymore (atleast, thats what it tells me)
- both .Picture and .ListImages() are not accepted. (I think they use .Image now instead of .Picture)
I've been trying to play around with Steve's help, and got so far already: (I've changed the original imgList1 with ImageList1)
| picBox1.Image = ImageList1.ImageCollection(0).image |
Again, something is not accepted. ImageList1.ImageCollection receives the curvy lines, saying
quote: 'ImageCollection' is a type in 'System.Windows.Forms.Imagelist' and cannot be used as an expression.
I've also tried to put in an imagestream, but I really don't know what I should do with that, so I ceased trying that.
Do I have to declare ImageList1 as an array? I've tried that as well, but couldn't figure out to do that.
Thanks again,
Thyrosis
____________________________
Thyrosis
vb.Net student
desperately seeking for answers :p
|
|
11-11-2005 at 09:36 AM |
|
|
NeNsEc Level: Protégé
 Registered: 05-12-2005 Posts: 4
|
Re: recalling image
Hmm, i hav sumsort of same problem:
When the user clicks on a record in lstData then it opens a new form whit more info about the record the user clicked on it. But it should also load a picture, hers my code:
(I cut everything away except for the picture part)
Private Sub lstData_Click()
...
On Error Resume Next
Set frmDataW.picWeapon.Picture = App.Path & "\Icons\Axe\" & rs("Picture") & ".jpg"
End Sub
|
Any ideas what im doing wrong? The rest works, the labels.
|
|
07-12-2005 at 07:30 PM |
|
|
|
|
 |
 |