offline
- Pridružio: 01 Nov 2015
- Poruke: 66
|
Napisano: 28 Nov 2016 19:52
Trebalo bi da vrti na pocetku random slova sve dok se ne pritisne dugme ali se nista ne desava!!!!
Dopuna: 28 Nov 2016 20:11
Sta ne valja:
int i;
string[] slova = new string[12];
Random rand = new Random();
private void button1_Click(object sender, EventArgs e)
{
Label[] label = new Label[] { label2,label3, label4, label5, label6, label7, label8, label9, label10, label11, label12,label13 };
for (int i = 0; i < 12; i++)
slova[i] = label[i].Text;
if (!button1.Enabled)
return;
if (button1.Text == "Start")
{
i = 0;
timer1.Enabled = true;
button1.Text = "Stop";
button1.Enabled = true;
}
else
{
label[i].Text = slova[i];
i = i + 1;
if (i == 12)
{
textBox1.Enabled = true;
button1.Enabled = false;
button1.Text = "Start";
timer1.Enabled = false;
//Vreme.Enabled = true;
textBox1.Focus();
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
char[] letters = new char[30] { 'A', 'Б', 'В', 'Г', 'Д', 'Ђ', 'Е', 'Ж', 'З', 'И', 'Ј', 'К', 'Л', 'Љ', 'М', 'Н', 'Њ', 'О', 'П', 'Р', 'С', 'Т', 'Ћ', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Џ', 'Ш' };
Label[] label = new Label[] { label2,label3, label4, label5, label6, label7, label8, label9, label10, label11, label12, label13 };
long ascii = 0;
ascii = rand.Next(65, 90);
while (!(ascii != Convert.ToInt32("W") & ascii != Convert.ToInt32("X") & ascii != Convert.ToInt32("Q")))
{
ascii = rand.Next(65, 90);
}
label[i].Text = Convert.ToString(ascii);
Application.DoEvents();*/
}
|