hello again.thanks for responding to my question.i used your idea of resetting all the buttons in the array to enabled=false. which works.(i dont know why you cant just disable the selected buttons

)
may i ask you a further question?
i have setup 2 stones using a picturebox array which works ok.but...
when i place the stones on top of one another half of one of the stones is obscured.ie if i move stone1 to position of stone2 i tell stone1 to locate at y+30 say which looks ok on screen.if stone1 is placed above stone2 it looks fine but when stone2 is placed above stone1 only half of stone2 is visible. why is this?
CODE
x=749;y=30;
for (int s = 0; s < 2; s++)
{
darkstone[s] = new PictureBox();
this.Controls.Add(darkstone[s]);
darkstone[s].Location = new Point(x,y);
darkstone[s].BackColor = Color.Transparent;
x -= 60;
darkstone[s].Paint+=new PaintEventHandler(stone_Paint );
darkstone[s].MouseDown += new System.Windows.Forms.MouseEventHandler(stone_MouseDown);
}
//stonetotal tells me how many stones are on each location
stonetotal.AddRange(new int[]{1,1,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0});
}
private void stone_Paint(object sender, PaintEventArgs e)
{
SolidBrush brush = new SolidBrush(Color.SandyBrown);
e.Graphics.FillEllipse(brush, 0, 0, 35, 35);
brush.Dispose();
}
private void nodarkstones()
{
stotal = stonetotal[counterindex]; stotal += 1;
stonetotal.RemoveAt(counterindex); stonetotal.Insert(counterindex, stotal);
if (stotal == 1)
{
y = 30;
}
if (stotal ==2)
{
y = 65;
}
}
private void chip_MouseClick(object sender, MouseEventArgs e)
{
choice = (Button)sender;
int chipsender;
chipsender = Array.IndexOf(chipmove, sender); //.ToString();
if( die1+counterindex<24)
{
if (choice.Equals(chipmove[die1 + counterindex]))
{
for (int i = 0; i < 24; i++)
{
chipmove[i].BackColor = Color.Cornsilk;
chipmove[i].Enabled = false;
}
die1used = 1;
}
}
if(die2+counterindex<24)
{
if (choice.Equals(chipmove[die2 + counterindex]))
{
for (int i = 0; i < 24; i++)
{
chipmove[i].BackColor = Color.Cornsilk;
chipmove[i].Enabled = false;
}
die2used = 1;
}
}
#region chipsender
switch (chipsender)
{
case 0:
darkstone[whichstone].Location=new Point(749, 30);
counterindex = 0;
break;
case 1:
counterindex = 1;
nodarkstones();
darkstone[whichstone].Location = new Point(689,y);
break;
case 2:
counterindex = 2;
nodarkstones();
darkstone[whichstone].Location = new Point(629,y);
break;
case 3:
counterindex = 3;
nodarkstones();
darkstone[whichstone].Location = new Point(569,y);
break;
case 4:
counterindex = 4;
nodarkstones();
darkstone[whichstone].Location = new Point(509,y);
break;
case 5:
counterindex = 5;
nodarkstones();
darkstone[whichstone].Location = new Point(449,y);
break;
case 6:
counterindex = 6;
nodarkstones();
darkstone[whichstone].Location = new Point(339,y);
break;
case 7:
counterindex = 7;
nodarkstones();
darkstone[whichstone].Location = new Point(279,y);
break;
case 8:
counterindex = 8;
nodarkstones();
darkstone[whichstone].Location = new Point(219,y);
break;
case 9:
counterindex = 9;
nodarkstones();
darkstone[whichstone].Location = new Point(159,y);
break;
//not done all locations yet just testing out code on 1st 9 locations
if (die1used == 1 && die2used != 1 && die2 + counterindex < 24)
{
chipmove[die2 + counterindex].Enabled = true;
chipmove[die2 + counterindex].BackColor = Color.Yellow;
//die2used = 1;
}
if (die1used != 1 && die2used == 1 && die1 + counterindex < 24)
{
chipmove[die1 + counterindex].Enabled = true;
chipmove[die1 + counterindex].BackColor = Color.Yellow;
//die1used = 1;
}
foreach (PictureBox p in darkstone)
{
if (p == sender)
{
psender = Array.IndexOf(darkstone, sender);
stoneloc =Convert.ToInt32( darkstone[psender].Location.X.ToString() + darkstone[psender].Location.Y.ToString());
counterindex = Array.IndexOf(counterplace, stoneloc);
whichstone = psender;
}
}
for (int i = 0; i < 24; i++)
{
chipmove[i].BackColor = Color.Cornsilk;
chipmove[i].Enabled = false;
}
}//chipmouseclick
again thanks for your help