private void button4_Click(object sender, EventArgs e) { frmBatterySizing DailyEnergyDemand = new frmBatterySizing(); DailyEnergyDemand.DailyEnergyDemand.Text = String.Format("{0:0.##}", Convert.ToDouble(label78.Text) / 1000); //data 1 DailyEnergyDemand.Show(); frmBatterySizing MaximumPowerDemand = new frmBatterySizing(); MaximumPowerDemand.MaximumPowerDemand.Text = String.Format("{0:0.##}", Convert.ToDouble(label79.Text) / 1000); // data 2 MaximumPowerDemand.Show(); } When button4 is clicked & i use the codings above the data1 and data 2 are displayed on each individually onto each separate forms.( that means 2 frmBatterySizing forms each with only one data) I want to display both datas (data 1 & data 2) on the same form (frmBatterySizing)simultaneously. how do i combine the codings? how to do modify?
cn u help me?
You're calling "new frmBatterySizing()" twice. So two (different) forms will be created. Try writing your program with just a single form.
Join our real-time social learning platform and learn together with your friends!