獲取控件的值並進行窗體間的傳遞

 public partial class FormTaxStatements : Form
    {

        public FormTaxStatements()
        {
            InitializeComponent();
        }

        private void btnChoice_Click(object sender, EventArgs e)
        {
            //FormChoiceCustomer frm = new FormChoiceCustomer();
            //frm.ShowDialog();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            string Date = dtpDate.Value.ToString("yyyy-MM-dd");
            string CustomerName = txtCustomerName.Text.Trim();
            string ProductName = txtProductName.Text.Trim();
            string Taxes = txtTaxes.Text.Trim();
            string Express = txtExpress.Text.Trim();
            string AccountName = txtAccountName.Text.Trim();

            //if (this.rbYes.Checked == true)
            // {
            //     string YesOrNO = rbYes.Text;
            // }
            //else if ( this.rbNo.Checked == true) 
            // {
            //     string YesOrNO = rbYes.Text; 
            // }
            string YesOrNO = cmbYesOrNO.SelectedItem.ToString(); 
            string PayNo = txtPayNo.Text.ToString();

            FormTaxStatementsPrint OrdersPrint = new FormTaxStatementsPrint(Date, CustomerName, ProductName, Taxes, Express, AccountName, YesOrNO, PayNo);
            OrdersPrint.Show();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("確定關閉?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                this.Close();
            }
        }
    }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章