在for循环中调用表单? [英] calling forms in a for loop??

查看:197
本文介绍了在for循环中调用表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在使用c#,我想循环调用表单,请尝试以下操作

Hey all
i''m using c# ,i want to call forms in loop i try the following

for (int i = 0; i <= 5; i++)
            {
                if (dty[i] == smthing)
                {
                    
                    checkingdisease cse = new checkingdisease();
                    
                    cse.Show();
                    
                }
            }


但它显示所有表示5种形式的形式;
我该如何正确显示仅一个表单,并在对该表单进行一些操作后显示下一个表单;
helppppp !!!!!!!!!!!!!!


but it displays all forms meaning 5 forms ;
how can i correct to display only one form and after doing some operation on thatform the next form will be displayed;
helppppp!!!!!!!!!!!!!!

推荐答案

为什么不显示单个表格,为什么不显示您只是显示了一个标签控件,其中包含每种疾病的一个标签?
Instead of showing individual forms, why don''t you just show a tab control that contains one tab for each disease?


您还可以考虑使用向导样式的表单,该表单使用户一次处理一组特定的表单.

这里是CodeProject上文章的链接:

向导表格实现 [
You could also considre using a wizard-style form that makes the user proceed through a specific set of forms one at a time.

Here''s a link to an article here on CodeProject:

Wizard Form Implementation[^]


代替Show()方法调用ShowDialog(),如下面的代码段:

Istead of the Show() method call the ShowDialog() one, as in the code snippet below:

for (int i = 0; i <= 5; i++)
{
    if (dty[i] == smthing)
    {
        checkingdisease cse = new checkingdisease();
        cse.ShowDialog();
    }
}


这篇关于在for循环中调用表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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