Global Değişkenimizi tanımlayın ilk olarak
FlowLayoutPanel f1;
Form Load Kısmına FlowLayoutPanelimizin özelliklerini ekleyip forma ekleyelim
f1 = new FlowLayoutPanel
{
Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))),
Location = new System.Drawing.Point(7, 50),
Name = "f1",
Size = new System.Drawing.Size(407, 235),
TabIndex = 1,
FlowDirection = FlowDirection.TopDown
};
Controls.Add(f1);1 Adet Button checkbox kontrolü ekletmek için
CheckBox c1 = new CheckBox();
c1.Text = "Test";
f1.Controls.Add(c1);1 Adet button daha ekleyin check kontrol için
foreach(CheckBox c in f1.Controls)
{
if(c.Checked)
{
// True ise
}
else
{
//False ise
}
}