using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RollTheDice
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnDice_Click(object sender, EventArgs e)
{
int Roll;
Random rand = new Random();
Roll = rand.Next(0,10);
diceDisplay.Text = btnDice.ToString();
}
}
}
텍스트 필드에 숫자를 출력 할 수 없으므로 오류가 발생하지 않습니다.임의 번호가 텍스트 상자에 나타나지 않습니다.
버튼을 클릭하면 시스템이됩니다. 오류가 그것을 보여 않지만 텍스트 상자에 random number
를 할당하지만 Button.ToString 할당되지 않은
글자를 숫자로 설정하지 않았습니다. btnDice.ToString()으로 설정합니다. diceDisplay.Text = roll.ToString()을 설정하십시오. –