我想在標籤中放入一些來自dll的文本。但它給了我一個錯誤: 「無法將方法組'getRondes'轉換爲非委託類型'標籤'」。無法將方法組'getRondes'轉換爲非委託類型'標籤'
這是從dll文件我的代碼:
public class Controller
{
private Spel _spel;
public void setSpelerMonster(string naam)
{
_spel.setSpelerMonster(naam);
}
public void setComputernaam(string naam)
{
_spel.setcomputernaam(naam);
}
public void setSpelerMonsterattack(int attack)
{
_spel.setSpelerMonsterattack(attack);
}
public void setcomputerattack(int attack)
{
_spel.setattack(attack);
}
public string getSpelerMonster()
{
return _spel.Speler.ToString();
}
public string getComputerMonster()
{
return _spel.Computer.ToString();
}
public int getRondes()
{
return _spel.Rondes;
}
public bool speelRonde()
{
return _spel.speelRonde();
}
public Controller()
{
_spel = new Spel();
}
}
,這是對我的WPF項目代碼:
private void btnstart_Click(object sender, RoutedEventArgs e)
{
txtnaam.Visibility = Visibility.Hidden;
btnstart.Visibility = Visibility.Hidden;
lblprogram.Visibility = Visibility.Visible;
sldaanvalskracht.Visibility = Visibility.Visible;
btnvalaan.Visibility = Visibility.Visible;
lblprogram = C.getRondes();
}
C.getRondes();給出了錯誤,但我不爲什麼
這就是答案感謝 –
@mar wanakhandaf不客氣。 – CNuts