我想让控件鼠标经过的时候图片会变.....
不好意思,上面那个没发完整
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.Image=Image.FromFile(路径+文件名);
}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.Image=Image.FromStream (路径+文件名);
}
凭感觉写的,呵呵,不知道有没有错误
水平有限
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
Cursor cr;
cr=new Cursor("..\\..\\no.cur");
this.Cursor=cr;
}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.Image = Image.FromFile(@"E:\photo\aa.jpg");
}
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.Image = Image.FromFile(@"E:\photo\bb.jpg");
}