Hi all,
I have a problem with PictureBoxes. I want use - Click on Picture Box (I have 8 picture boxes with different colors) and I want that the color from box when I click on write on other picture box.. I hope that you know what I mean this and sorry for my English..
Loading
Hirendra SisodiyaPosted Mar 30, 2010, 10:38 AM
thanks
Please mark as answere if it helps
VPosted May 11, 2010, 4:00 AM
I have this code and I need: Click on button "Vyhodnotit" and the small pictureboxes fill with black and white color.. When you have color on same place as in auto generate line, first little picturebox fill in black color etc.. And If I find the same color as in auto generate line but the color will be wrong place, the little picturebox fill in white color.. (GAME MASTERMIND)
Could you help me with code? I tried this a long time but unsuccesfull :-(
VPosted Mar 30, 2010, 9:00 AM
I appreciate your holpen!!
Hirendra SisodiyaPosted Mar 30, 2010, 8:24 AM
you are right, you can choose random color like:
Random rnd =new Random();
Color clr = Color.FromArgb(rnd.Next(0,255),rnd.Next(0,255), rnd.Next(0,255));
and for going one step back replace this code on vyhodnotit_Click event:
if (count == 4)
{
count = 0;
}
and put this code on back_Click event:
Totalcount=Totalcount-1;
count=count-1;
if (count <= 3)
{
if (Totalcount >= 0 && Totalcount <= 3)
{
picBox_Set_1[count].BackColor = Color.White;
}
if (Totalcount >= 4 && Totalcount <= 7)
{
picBox_Set_2[count].BackColor = Color.White;
}
if (Totalcount >= 8 && Totalcount <= 11)
{
picBox_Set_3[count].BackColor = Color.White;
}
if (Totalcount >= 12 && Totalcount <= 15)
{
picBox_Set_4[count].BackColor = Color.White;
}
if (Totalcount >= 16 && Totalcount <= 19)
{
picBox_Set_5[count].BackColor = Color.White;
}
if (Totalcount >= 20 && Totalcount <= 23)
{
picBox_Set_6[count].BackColor = Color.White;
}
if (Totalcount >= 24 && Totalcount <= 27)
{
picBox_Set_7[count].BackColor = Color.White;
}
if (Totalcount >= 28 && Totalcount <= 31)
{
picBox_Set_8[count].BackColor = Color.White;
}
if (Totalcount >= 32 && Totalcount <= 35)
{
picBox_Set_9[count].BackColor = Color.White;
}
if (Totalcount >= 36 && Totalcount <= 39)
{
picBox_Set_10[count].BackColor = Color.White;
}
if (Totalcount >= 40 && Totalcount <= 43)
{
picBox_Set_10[count].BackColor = Color.White;
}
}
thanks
Please mark as answere if it helps
VPosted Mar 30, 2010, 7:26 AM
Color = Color.FromArgb( (rnd.Next(0,255)), (rnd.Next(0,255), ....... );
(rnd.Next(0,255)) );
or it is totally rubissh?
And button "Zpet" in translate is Back.. How can I implement one step back in choosing colors?
Hirendra SisodiyaPosted Mar 30, 2010, 6:20 AM
Hello
i checked your code,your buttons click event were not working,i have made changes about such things such as now i generate joint click event of Buttons of color palate.
now your application works fine, download it and test..
thanks
Please mark as answere if it helps
VPosted Mar 30, 2010, 5:41 AM
It helped me, thanks very much, but it doesn't work in my Project and I don't know what?! I upload my Project here.
Hirendra SisodiyaPosted Mar 30, 2010, 3:35 AM
Hello V
we can do this by taking some array of controls, i have developed a sample application that behaves according you
please see attached WindowApplication1.zip application.
thanks
Please mark as answere if it helps
VPosted Mar 29, 2010, 8:41 AM
Hirendra SisodiyaPosted Mar 29, 2010, 8:20 AM
thanks