鼠标点击图片框的事件 [英] mouse click event of picture box

查看:113
本文介绍了鼠标点击图片框的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改图片框的鼠标点击事件上的图像

推荐答案

试试这个:



Try this :

Private Sub PictureBox1_Click(sender As System.Object, e As System.EventArgs) Handles PictureBox1.Click
    PictureBox1.Image = Image.FromFile("c:\myImage.jpg")
End Sub





我用一个表单创建了一个新项目,添加了一个PictureBox,其图像字段设置在该PictureBox的属性中。然后在那里添加了sc来改变文件中的图像。



I created a new project with one form, added a PictureBox with an image set at the image field from the properties of that PictureBox. Then added that sc up there just to change the image from file.


这篇关于鼠标点击图片框的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆