Hi,
i have a little problem, i dynamic generate a buttons in two columns
for(i=0;i<=10;i++){
Button prz = new Button();
prz.Location = new Point(12,40+i*25);
prz.Name = "But"+(p-i)+"up";
prz.Image = Image.FromFile(picture_from_file_1);
prz.ClientSize = new Size(20,20);
prz.Click += new System.EventHandler(this.Button_Click_Code);
Controls.Add(prz);
Button prz1 = new Button();
prz1.Location = new Point(45, 40 + i * 25);
prz1.Name = "But" + (p - i) + "down";
prz1.Image = Image.FromFile(picture_from_file_2);
prz1.ClientSize = new Size(20, 20);
prz1.Click += new System.EventHandler(this.Button_Click_Code);
Controls.Add(prz1);
}
and
private void Button_Click_Code(object sender, EventArgs e)
{
Button myBut = (Button)sender;
switch (myBut.Name)
{
case "But0up":
break;
case "But0down":
break;
case "But1up":
break;
case "But1down":
break;
case "But2up":
break;
case "But2down":
break;
...
...
...
case "But10up":
break;
case "But10down":
break;
}
}
how can i disable for example But2down when i click But2up or But1up when i click But1down?
thx 4 help