如何在表单加载之前加载图片 [英] How Do I Make Pictures Load Before Form Loads
问题描述
你好!
我一直想编程,但我从不费心学习语言。
然后我发现Visual Basic,它似乎完成了这项工作,我的意思是我可以做我想学习的基本内容,如果我有这种感觉,我可以使用相同的软件来学习C ++,C#或JavaScript。
所以故事,sry。 (不知道为什么我添加了这个)
但我想知道,我如何制作我要使用的图像,在表格打开之前加载?
我曾做过一个项目只是为了尝试和试验,但我从来没有发现过。
另外,我真的,真的为糟糕的英语道歉,如果已经有人问过,我还在学习这个网页! :)
公共 类 mm
Dim 测试作为图片
Dim Test2 As 图片
私人 Sub mm_Load(发件人作为 对象,e As EventArgs)句柄 MyBase .Load
Test = My.Resources.tester
Test2 = My.Resources.tester2
End Sub
私有 Sub PictureBox1_MouseHover(发件人作为 对象,e As EventArgs)句柄 PictureBox1.MouseHover
PictureBox1 .Image =测试
结束 Sub
私有 Sub PictureBox1_MouseLeave(发件人 As Object ,e As EventArgs)句柄 PictureBox1.MouseLeave
PictureBox1.Image = Test2
结束 Sub
结束 类
我发现了问题(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.
这篇关于如何在表单加载之前加载图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!