public static int RollDice()
{
int die1 = randomNumbers.Next(1, 7);
int die2 = randomNumbers.Next(1, 7);
int sum = die1 + die2;
{
int die1 = randomNumbers.Next(1, 7);
int die2 = randomNumbers.Next(1, 7);
int sum = die1 + die2;
MessageBox.Show( Convert.ToString(die1) + Convert.ToString(die2) + Convert.ToString(sum));
return sum;
}
现在静态方法返回的是sum 本人想把 die1 die2 sum 都单独显示在textBox中怎么搞!
高手来一个
解决方案
5
把textBox通过参数传进去,就可以在静态方法中显示
30
加两个ref或out参数