2012-05-05 162 views

回答

4

你只需要訂閱MouseHover事件更改圖像屬性。

這應該做的伎倆:

PictureBox o = new PictureBox(); 
o.MouseHover += (a_sender, a_args) => 
{ 
    PictureBox pic = a_sender as PicureBox; 
    pic.Image = null // New Image.. 
}; 

同樣,當你需要恢復以前的圖片使用:MouseLeave

0

在PictureBox的性質,對事件MouseEnter雙擊和使用:

(sender as PictureBox).Image = Image.FromFile(// path of image1); 

然後雙擊事件MouseLeave並使用:

(sender as PictureBox).Image = Image.FromFile(// path of image2); 
+0

FromFile或FromStrean ... – ndukan

相關問題