locked
Creating A Dot Net Windows Summary to Detail Application RRS feed

  • Question

  •  

    I am creating a dot net windows application which has a summary report.  I want to pass a key variable from the summary report to a detail report.  These reports are totally seperate(they have different forms).  How do I do this ?
    Wednesday, July 30, 2008 7:47 PM

Answers

  • Hi john bracken

     

    Base on my understanding, you want to transmit a variable in the Summary Form to the Detail Form, don’t you?

    If my understanding is right, I think you have many way to do this.

    1. Transmit the variable to the Detail Form by its constructor

    2. Transmit the variable to the property of the Detail Form.

    Code Example:

    Your Detail Form

    Code Snippet

    public partial class FrmDetail : Form

        {

            private int _keyValue;

     

            public FrmDetail()

            {

                InitializeComponent();

            }

     

            public FrmDetail(int keyValue)

            {

                InitializeComponent();

                _keyValue = keyValue;

            }

     

            public int KeyValue

            {

                get

                {

                    return _keyValue;

                }

                set

                {

                    _keyValue = value;

                }

            }

    }

     

     

    Transmit the variable to the Detail Form by its constructor

    Code Snippet

    FrmDetail frmDeatil = new FrmDetail(this._sumKeyValue);

    frmDeatil.Show();

     

     

     

    Transmit the variable to the Detail Form by its property

    Code Snippet

    FrmDetail frmDeatil = new FrmDetail();

    frmDeatil.KeyValue = this._sumKeyValue;

    frmDeatil.Show();

     

     

     

    If you have any more question, please feel free to tell me.

     

    Best Regards,

    Kira Qian

     

    Windows Forms General FAQs
    Windows Forms Data Controls and Databinding FAQs

     

    Monday, August 4, 2008 5:41 AM