Hi,
So i created a form called board. and on this form placed a whole heap of labels, buttons and a menu. Now from the menu there is a New Game option. When this is clicked a new form is opened called New Game. once you are finished filling in details the New Game form disappears. The board form is still there, has always been there but now i want certain labels to turn invisible.
so in the board class i have all the VS2005 code making all the stuff and in the New Game form i have a button click event that makes the New Game form hide and calls a method called game.StartGame( );
the new game form disappears alright and the code keeps going but the labels i want to change don't go invisible. I also create a button that doesn't show up either. i use the board.Controls. Add(button); and i ended up creating a method called HideLabels. code is as follows
(inside board class)
public void HideLabels(){
lblName.Visible = false;
}
(inside new game class)
private void btnPlayerOK_Cli ck(object sender, EventArgs e){
game.StartGame( );
this.Hide();
}
(inside game class)
public void StartGame(){
board.HideLabel s()
}
now i know the code reads the HideLabels cod ebecuase i tested by asking it to open a message box after the visible = false. the message box appeared but the label was still there.
Why? and why doesn't my buttons show up even though i add them?
thanks in advance
So i created a form called board. and on this form placed a whole heap of labels, buttons and a menu. Now from the menu there is a New Game option. When this is clicked a new form is opened called New Game. once you are finished filling in details the New Game form disappears. The board form is still there, has always been there but now i want certain labels to turn invisible.
so in the board class i have all the VS2005 code making all the stuff and in the New Game form i have a button click event that makes the New Game form hide and calls a method called game.StartGame( );
the new game form disappears alright and the code keeps going but the labels i want to change don't go invisible. I also create a button that doesn't show up either. i use the board.Controls. Add(button); and i ended up creating a method called HideLabels. code is as follows
(inside board class)
public void HideLabels(){
lblName.Visible = false;
}
(inside new game class)
private void btnPlayerOK_Cli ck(object sender, EventArgs e){
game.StartGame( );
this.Hide();
}
(inside game class)
public void StartGame(){
board.HideLabel s()
}
now i know the code reads the HideLabels cod ebecuase i tested by asking it to open a message box after the visible = false. the message box appeared but the label was still there.
Why? and why doesn't my buttons show up even though i add them?
thanks in advance
Comment