rm1′deki checkedListBox’ın items’nı Form2′ye çağırma ve label’e yazdırma — C#
Form1
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication7 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static string deger; private void button1_Click(object sender, EventArgs e) { deger = checkedListBox1.Items[0].ToString(); Form2 frm2 = new Form2(); frm2.Show(); } } }
Form2
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication7 { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { label1.Text = Form1.deger.ToString(); } } }