窗体之间的值在C#.NET中 [英] Values between windows forms in C# .NET

查看:122
本文介绍了窗体之间的值在C#.NET中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种形式,在主要的一个有一个crystalreportviewer,在另一个用户介绍他想要在报表上的用户的ID。问题我想让用户在报告加载信息之前引入ID,所以当用户在报告加载信息之前单击CreateReport按钮时,我创建了一个新的表单来介绍ID,问题是指令继续即使新窗口打开也会执行。我知道是逻辑的问题,而不是programmin也许你可以帮助我=)。
我以一个构造函数的形式,所以值可以传递。

I have two forms, in the main one a have a crystalreportviewer and in the other one the user introduces the ID of the user he wants to be on the report. The problem I want the user to introduce the ID before the report loads the information, so when the user clicks the CreateReport button just before the report loads the info, I created a new form to introduce the ID, the problem is that instructions continue to execute even though the new window is open. I know is a problem of logic instead of programmin maybe you can help me =). I made a constructor in the form so the values can be passed.

这里是按钮的代码:

    private void usuariosToolStripMenuItem_Click(object sender, EventArgs e)
    {

            RPE formRPE = new RPE(); //NEW FORM CREATED
            frmRPE.Show();//RPE FORM CALLED
            this.Hide();

        //BUT IT GOES ON

            ReportDocument guantesRpt = new reporteGuantes();

            DataTable datatableGuantes = reporteguantes.obtenerTabla();
            guantesRpt.SetDataSource(datatableGuantes);





            rptViewerGuantes.ReportSource = guantesRpt;
            //  Usuariorpt.SetParameterValue("RPE", RPE);



    }


推荐答案

ShowDialog(...)

ShowDialog(...)

这篇关于窗体之间的值在C#.NET中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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