sos
错误列表一直显示这个:命名参数规范必须出现在所有指定的固定参数后
错误的地方在最后一串代码“MessageBoxButtons”
以下是代码,怎么改呀?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
struct Word //建立一个结构体,是一个词汇本
{
public string english;//建立英文
public string chinese;//建立英文
}
List<Word> words = new List<Word>();//建立一个词汇表
//该List是word类型的
public static int index = 0;
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
Word word = new Word();
word.chinese = "苹果";
word.english = "apple";
words.Add(word);
word.chinese = "香蕉";
word.english = "banana";
words.Add(word);
word.chinese = "男孩";
word.english = "boy";
words.Add(word);
label1.Visible = false;//中文标签(label)的Name为“label1”
label2.Text = words[index].english;//中文标签(labe2)的Name为“label2”
}
private void buttonSubmit_Click(object sender, EventArgs e)
{
if (words[index].chinese == textBox1.Text)
{
label1.Visible = true;
MessageBox.Show(text: "答案正确", caption: "提示",**MessageBoxButtons**.OK,MessageBoxIcon.Information);
}
}
}
直接
MessageBox.Show("答案正确", "提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
不行么?
可能是调用方法的时候部分没有给参数名和值