111,097
社区成员




private void button1_Click(object sender, EventArgs e)
if (mt==1)
{
cc = true;
}
else
{
pictureBox1.Visible = true;
cc = false;
}
public bool cc
{
set {
if(value)
{
SoundPlayer sp = new SoundPlayer(@"C:/SSM/cry.wav");//播放音频
textBox1.text = "Punishment";
}
}
private void button1_Click(object sender, EventArgs e)
if (mt==1)
{
cc = true;
//直接写这里啊
SoundPlayer sp = new SoundPlayer(@"C:/SSM/cry.wav");//播放音频
textBox1.text = "Punishment";
}
else
{
pictureBox1.Visible = true;
cc = false;
}
private void button1_Click(object sender, EventArgs e)
{
bool 乖不乖 = true;
int 张三的分数 = 59;
if (张三的分数 < 60)
{
乖不乖 = false;
}
挨打("张三", 乖不乖);
}
//公共程序是指这个?
private void 挨打(string 姓名,bool 乖不乖)
{
if (乖不乖)
{
MessageBox.Show(姓名 + "是好孩子。");
}
else
{
MessageBox.Show(姓名 + "要挨打!");
}
}
public class bool cc; //这句应该怎么写?
{
if (cc)
{
SoundPlayer sp = new SoundPlayer(@"C:/SSM/cry.wav");//播放音频
textBox1.text = "Punishment";
}
else
{
...
}
}