StrataFrame Forum

Close Form Popup before opening MessageBox.Show and the form use delegate ?

http://forum.strataframe.net/Topic33338.aspx

By Dong Trien Lam - 7/17/2016

Suppose you have two forms: frmMain and frmPopup, on frmMain has 1 button (the button) click open frmPopup, on frmPopup many (button), you click on the button any frmPopup button will transmit data by the delegate of copper frmMain frmPopup before closing time announced new open yes / no of MessageBox.Show. When your done click the close button again poup frmPopup then MessageBox.Show on frmPopup, frmPopup refused to play, until the click buttons yes/no of MessageBox.Show, click the button here as yes / no, then frmPopup and MessageBox. Show it to close. I want to play a new fat frmPopup MessageBox.Show done. Their code has the following structure:


//Declare frmMain

public partial class frmMain : Form

    {

        // Declare delegate transmissions data  ...

        private void getData(data)

        { 

            //...

            if (conditions) Updata();

        }

        public frmMain()

        {            

            InitializeComponent();

        }

        private void cmdfrmPopup_Click(object sender, EventArgs e)

        {

             frmPopup frm = new frmPopup(data);  

             frm.Data = getData;

             frm.ShowDialog();

        }

        private void Updata()

        {

             DialogResult dlgRes; 

             string sAskUser = "Are you sure delete ?" ...

             dlgRes = MessageBox.Show(sAskUser, "warning..", MessageBoxButtons.YesNo, Question);

             if (dlgRes == DialogResult.OK)

            {

                // do somthing

            }

        }

    }

    

 //Khai báo frmPoup

public partial class frmPopup : Form

    {

        // Declare delegate transmissions data ...

        public frmPopup(nhandulieuden)

        {

            InitializeComponent();

            //...            

        }


        private void cmdButton1_Click(object sender, EventArgs e)

        {

            Process();

        }

        

        private void cmdButton2_Click(object sender, EventArgs e)

        {

            Process();  

        }

        

        private void cmdButton3_Click(object sender, EventArgs e)

        {

            Process();

        }

        

        private void cmdButton4_Click(object sender, EventArgs e)

        {

            Process();

        }

        private void Xuly()

        {

            // to do somthing..

            

            // This Brushes their 2 statements for each island has been the case presented above

            this.Close();

            transmissionOffrmMain(data);           

        }

        private void cmdExit_Click(object sender, EventArgs e)

        {

             this.Close();

        }

        

    }

}    


through available tracks your household help this place.