none
How i used Checkbox in another form in if Condition in C# WinApp RRS feed

  • General discussion

  • I have two form ...

    first form have 8 checkbox .

    second form is have crystal report viewer :-

    private void FRM_RPT_CAR_ID_Load(object sender, EventArgs e)
            {
                    form1 frm=new form1();
                   if(frm.checkbox1.checked)

                   {

                    s = "select s1.Car_id,  convert(varchar,s1.Change_date,101) as Change_date, Service_Type.Servce_desc,s1.Current_dist, s1.Prev_distance as Prev_dist, (s1.Current_dist -                                         s1.Prev_distance) as Change_dist ,s1.value_Tashhem as Value from Tashhem s1 INNER JOIN Service_Type ON s1.Servce_id = Service_Type.Servce_id where s1.Car_id =" +                              x;
                    DataSet_Car_id ds = new DataSet_Car_id();
                    SqlDataAdapter dataAdapter = new SqlDataAdapter(s, con);
                    dataAdapter.Fill(ds.Tables["Car_Details"]);
                    CrystalReport_Car_id report = new CrystalReport_Car_id();
                    report.SetDataSource(ds.Tables["Car_Details"]);
                    crystalReportViewer_Car_id.ReportSource = report;
                    crystalReportViewer_Car_id.Refresh();

                   }

    }

    how i pass check box from form1 to form2 in C#

    Tuesday, January 26, 2016 7:32 AM

All replies