Microsoft Visuel Studio [英] Microsoft Visuel Studio

查看:91
本文介绍了Microsoft Visuel Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Microsoft Visuel Studio项目。并且有一个致力于该图片,并且这个图像pıctureBoxım被点击,我想打开另一个表单,但我无法做到这一点感谢帮助

I created a project Microsoft Visuel Studio. and there's one devoted to that picture, and this image pıctureBoxım is clicked, I want to open another form, but I couldn't do it thanks for the help

推荐答案

啊 - 简单。

处理PictureBox的Click事件:

在设计视图中打开表单,然后双击图片框。这将创建一个Click处理程序方法,并将其附加到PIctureBox。

然后只需更改代码即可:

Ah - easy.
Handle the Click event for the PictureBox:
Open the form in Design view and double click on the picture box. This will create a Click handler method, and attach it to the PIctureBox.
Then just change the code to resemble this:
private void myPictureBox_Click(object sender, EventArgs e)
    {
    frmTest form = new frmTest();
    form.Show();
    }

其中 frmTest 是您要显示的表单类的名称。

Where frmTest is the name of the form class you want to display.


好吧,你可以处理事件 System.Windows.Forms.PictureBox.Click 并在事件处理程序中打开表单:

http://msdn.microsoft.com/en-us /library/system.windows.forms.control.click(v=vs.110).aspx [ ^ ]。



-SA
Well, you can handle the event System.Windows.Forms.PictureBox.Click and open the form in the event handler:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.click(v=vs.110).aspx[^].

—SA


这篇关于Microsoft Visuel Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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