且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在表单加载之前加载图片

更新时间:2023-12-05 17:33:16

我发现了问题(Visual Basic)



我发现使用了



PictureBox.MouseHover只会当鼠标停止移动到图像顶部时触发。



使用 - 〜-.MouseEnter,当鼠标进入图像时立即触发。

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! :)

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

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.