GroupBox içindeki seçili CheckBox’ları ListBox’a ekle C#
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;//www.gorselprogramlama.com
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace groupbox_secili_checkbox_listbox_ekle
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();//www.gorselprogramlama.com
}
private void btnEkle_Click(object sender, EventArgs e)
{//www.gorselprogramlama.com
listBox1.Items.Clear();
foreach (Control kontrol in this.groupBox1.Controls)
{
if (kontrol is CheckBox) //www.gorselprogramlama.com
{
if (((CheckBox)kontrol).Checked == true)
{
listBox1.Items.Add( ((CheckBox)kontrol).Text.ToString());
}
}
}//www.gorselprogramlama.com
}
}
}
[/code]



merhaba elinize sağlık. Benim sorum şu yanyana yazdırmak istersek nasıl yazdıracağız? Teşekkürler.