private void RBClick(object sender, EventArgs e) { RadioButton rb = (RadioButton)sender; gtype = (GameTypeEnum.GameType)Int32.Parse(rb.Name.Substring(rb.Name.Length - 1, 1)); if (gtype == GameTypeEnum.GameType.PvAIX) { SetVisibility(); pnlPvAI.Visible = true; } else if (gtype == GameTypeEnum.GameType.Client) { SetVisibility(); pnlIpAddress.Visible = true; } else if (gtype == GameTypeEnum.GameType.PvP) { SetVisibility(); cboxTimed.Visible = true; } else { SetVisibility(); } //MessageBox.Show(""+gtype); enum string'i }
public PvP(GameTypeEnum.GameType gtype) { InitializeComponent(); this.gtype = gtype; this.Width = 468; this.Height = 750; this.StartPosition = FormStartPosition.Manual; this.Left = 200; this.Top = 10; BuildGameField(); }
private void rbX_Click(object sender, EventArgs e) { gtype = GameTypeEnum.GameType.PvAIX; }
private void cboxTimed_Click(object sender, EventArgs e) { gtype = cboxTimed.Checked? GameTypeEnum.GameType.PvPTimed:GameTypeEnum.GameType.PvP; }