私はWindowsフォームを使用して新しいウィンドウを作成しようとしている、と私はこのエラーを取得しています:C#が - > Windowsフォーム新しいウィンドウを表示するトラブル
" 'whichDiceGameForm' does not contain a definition for 'show' and no extension method 'show' accepting a first argument of type 'whichDiceGameForm' could be found (are you missing a using directive or an assembly reference?) "
public partial class mainForm : Form
{
public mainForm()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void mainForm_Load(object sender, EventArgs e)
{
title.Font = new Font("Arial", 10, FontStyle.Bold);
}
private void startButton_Click(object sender, EventArgs e)
{
radioDice.Tag = new whichDiceGameForm();
radioCard.Tag = new whichCardGame();
mainForm f = null;
if (radioDice.Checked)
f = new whichDiceGameForm();
else
if (radioCard.Checked)
f = new whichCardGame();
f.Show();
}
}
EDIT *ここではwhichDiceGameFormコードです:
public partial class whichDiceGameForm : Form
{
public whichDiceGameForm()
{
InitializeComponent();
}
private void whichDiceGameForm_Load(object sender, EventArgs e)
{
}
}
どのように私たちに「のコードを示す程度whichDiceGameForm "?明らかにあなたはショー機能を与えたことがないからです。あなたはそれを正しく継承しましたか?mainFormのようなFormからForm? – Christopher
'show()'と 'Show()'はあなたがスノーブラインドに行った場合に違います) – FortyTwo
@Christopher私はちょうどそれを追加しました。 – BobFisher3