在同一窗口中添加新表单 [英] Adding new form in the same window

查看:32
本文介绍了在同一窗口中添加新表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 的 C# 窗口表单上有这个链接:

I have this link on my windows form in C# on visual studio:

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // Show another form.
            Form2 f2 = new Form2();
            f2.Show(this);
            linkLabel1.LinkVisited = true;
        }

我想要当我按下链接时,新表单将被创建在同一个窗口上而不出现在另一个窗口上.我该怎么做?

I want when i press the link,the new form which will be created to be on the same window and not appeared on another window.How can i do this?

推荐答案

将您的 .Show 更改为 .ShowDialog.这将使它成为一个模态对话框窗口".

change your .Show to .ShowDialog. This will make it a modal dialog "window".

这篇关于在同一窗口中添加新表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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