cannot convert from string to system.windows.forms.string iwin32window
Posted
by Michael Quiles
on Stack Overflow
See other posts from Stack Overflow
or by Michael Quiles
Published on 2010-05-24T13:14:16Z
Indexed on
2010/05/24
13:21 UTC
Read the original article
Hit count: 223
c#
This is supposed to show the winner in the xWinner form label but I cant figure it out. xWinnerForm.Show(b1.Text);. I'm new to c# so can you please explain in layman terms thanks.
static public bool CheckWinner(Button[] myControls)
{
bool gameOver = false;
for (int i = 0; i < 8; i++)
{
int a = Winners[i, 0];
int b = Winners[i, 1];
int c = Winners[i, 2];
Button b1 = myControls[a], b2 = myControls[b], b3 = myControls[c];
if (b1.Text == "" || b2.Text == "" || b3.Text == "")
continue;
if (b1.Text == b2.Text && b2.Text == b3.Text)
{
gameOver = true;
Form xWinnerForm = new xWinnerForm();
xWinnerForm.Show(b1.Text);
}
public void Show(string text)
{
this.xWinnerLabel.Text = text;
this.Show();
}
}
return gameOver;
}
© Stack Overflow or respective owner