I have two Frorms - Form2 and Form3. In Form2 I've created variable checkedText by following way:
List<string> checkedCheckboxes = new List<string>();
CheckBox[] checkBoxes = new CheckBox[] { chbts3, chbda3, chbb50, chbg50, chbapc, chbpbw,
chbbwp, chbwwbw, chbiconscp, chbiconsmile, chbmdm, chbpica,
chbmypim, chbagile, chbscrm, chbwwapo, chbkc, chba50, chbtimetrends,
chbwawe, chbteamcenter, chbvhub, chbgpg, chbpmg, chbd7w, chbsteelwedge,
chbsrs, chbpwrchncosmo, chbavailsvc, chbphweb, chbmrs, chbicondt};
foreach (CheckBox checkbox in checkBoxes)
{
if (checkbox.Checked)
{
checkedCheckboxes.Add(checkbox.Text);
}
}
string checkedText = String.Join("|", checkedCheckboxes);
And I'd like to use this variable in Form3. How can I do that without creating any textbox or label. Thanks a lot for any of your advice in advance.