I made a GUI using windows forms. Just wondering if it is possible to add a mousehover event for picture boxes (New-Object System.Windows.Forms.PictureBox).
我使用Windows窗*作了一个GUI。只是想知道是否可以为图片框添加鼠标悬停事件(New-Object System.Windows.Forms.PictureBox)。
A quick workaround I had made is to create invisible buttons where the picture boxes are and add .add_mousehover and .add_mouseleave events on that button. Rather messy, really.
我做的一个快速解决方法是创建图片框所在的隐形按钮,并在该按钮上添加.add_mousehover和.add_mouseleave事件。相当凌乱,真的。
Any ideas?
有任何想法吗?
1 个解决方案
#1
1
You can add the add_mousehover tho your System.Windows.Forms.PictureBox object.
您可以在System.Windows.Forms.PictureBox对象中添加add_mousehover。
$test = {MSG * 1}
$pictureBox1 = New-Object System.Windows.Forms.PictureBox
$pictureBox1.add_mousehover($test)
#1
1
You can add the add_mousehover tho your System.Windows.Forms.PictureBox object.
您可以在System.Windows.Forms.PictureBox对象中添加add_mousehover。
$test = {MSG * 1}
$pictureBox1 = New-Object System.Windows.Forms.PictureBox
$pictureBox1.add_mousehover($test)