Pow tava fazendu o jogo da forca aki…keria uma ajuda aew d vcs pra terminar…
VO posta aki o q eu ja fiz !!!
po esse ai, é oq faz o textbox ganhar os " _ "… correspondente ao numero de letras da palavra…
private void button28_Click(Object sender, System.EventArgs e)
{
String s1 = textBox1.get_text();
String s2 = “”;
for (int i = 0; i < s1.length(); i++)
s2 = s2 + ‘_’;
textBox2.set_text(s2);
numerro = 0;
}
Esse ai é pra fzr a obtenção das letras do teclado
private void button1_Click(Object sender, System.EventArgs e)
{
int x = busca(textBox1.get_Text(), “A”);
if (x == -1)
numerro++;
if (numerro == maxerro)
label1.set_text(" Você perdeu");
}
esse é pra verificar a letra inserida efzr a verificação…
int busca(String s1, char ch)
{
String s2 = textBox2.get_Text();
String s3 = “”;
int ind = s1.indexOf(ch);
if (ind == -1) return -1;
for (int i = 0; i < s1.length(); i++)
if (i == ind)
s3 = s3 + ch;
else
s3 = s3 + s2.charAt(i);
textBox2.set_Text(s3);
}
}
po eu to tendo um pokin d dificuldade em fzr a classe… os eventos clicks nos botões axo q tão certos… mas a classe ta meio xata d fzr
fzr os metodos q eu uso nos clicks…
vcs podem me ajudar c isso ?
obrigado