Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello there!

I always wanted to program something, but i never bothered with learning a launguage.

Then i found Visual Basic, and it seems to do the job, i mean i can do the basic stuff i wanted to learn, and if i ever feel like it, i can use the same software to learn C++, C# or JavaScript.

So theres the story, sry. ( Dont know why i added that )

But im wondering, how do i make images that im gonna use, load before the form is opened?

I once made a project just to try and experiment around, but i never found out.

Also, i really, REALLY apologize for bad english and if this already has been asked, im still learning this webside! :)

VB
Public Class mm

   Dim Test As Image
   Dim Test2 As Image

  Private Sub mm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Test = My.Resources.tester
        Test2 = My.Resources.tester2

End Sub


    Private Sub PictureBox1_MouseHover(sender As Object, e As EventArgs) Handles PictureBox1.MouseHover
        PictureBox1.Image = Test

    End Sub

    Private Sub PictureBox1_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox1.MouseLeave
        PictureBox1.Image = Test2
    End Sub
End Class
Posted
Updated 8-Feb-14 12:33pm
v3
Comments
Vedat Ozan Oner 8-Feb-14 17:04pm    
You cannot, Adrian. Start from the beginning. See here: http://msdn.microsoft.com/en-us/library/z9w2f38k%28v=vs.110%29.aspx
Adrian Ulland 8-Feb-14 17:18pm    
I know the basics of making programs, i just wanted to stop images delaying the arrival due to them not loading before i request them to show up.
Vedat Ozan Oner 8-Feb-14 17:34pm    
are you downloading it from somewhere else? it shouldn't delay if the image is on your hdd. it would be better to send some code to discuss on it.
Adrian Ulland 8-Feb-14 17:52pm    
I currently have no code to show, i deleted all my projects, and i have now started a new one... But the images are loaded from the resource file.
Vedat Ozan Oner 8-Feb-14 17:54pm    
then, don't worry about the delay to read from the disc. it doesn't change anything. if you would load it from a remote host, I would advice you to use some async techniques. but it is unnecessary for your case.

1 solution

I found the problem (Visual Basic)

I found out that using

PictureBox.MouseHover will only trigger when the mouse has stopped moving ontop of the image.

Using -~-.MouseEnter however, makes it trigger right away when your mouse enters the image.
 
Share this answer
 
Comments
thatraja 10-Feb-14 3:27am    
5! for your solution. Keep doing this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900