//图书类
    class booktype
    {
        private int booktypeid;
        private string booktypename;
        private string re;        public int Booktypeid
        {
            get { return booktypeid; }
            set { booktypeid = value; }
        }        public string Booktypename
        {
            get { return booktypename; }
            set { booktypename = value; }
        }        public string Re
        {
            get { return re; }
            set { re=value;}
        }
        public booktype(int booktypeid, string typename, string re)
        {
            this.booktypeid = booktypeid;
            this.booktypename = typename;
            this.re = re;
        }
    }
  //点击事件
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            TreeNode cnode = this.treebooktype.SelectedNode;
            if (cnode != null && cnode.Level == 1)
            {
                MessageBox.Show(cnode.Text);
                model.booktype bkty = cnode.Tag as model.booktype;
                frmBookType frm = new frmBookType(this, bkty);
                frm.ShowDialog();
            }
        }
    //构造方法用于初始化frmmain对象和booktype方法
  public partial class frmMain : Form
    {
        public frmBookType(frmMain frm,model.booktype type)
        {
            this._frm = frm;
            this._type = type;
            InitializeComponent();
        }
}错误 1 可访问性不一致: 参数类型“图书管理系统.model.booktype”
比方法“图书管理系统.frmBookType.frmBookType(图书管理系统.frmMain,
图书管理系统.model.booktype)”的可访问性低F:\学习园地\S2\project\图书管理系统\图书管理系统\图书管理系统\frmBookType.cs 32 16 图书管理系统
高手指点,请问这里那里出问题了???

解决方案 »

  1.   

    public partial class frmMain : Form
        {
            public frmBookType(frmMain frm,model.booktype type)这个是构造函数吗?为什么明知和类名不一样?
      

  2.   

    加一个public在class booktype前。
      

  3.   

    你的class booktype是默认internal的
    但是
    public frmBookType(frmMain frm,model.booktype type) 是public的当你在一个访问性比较强(例如公共)的字段/属性/方法里使用自定义类型,而这个类型访问性比较低(例如保护/私有)的时候就发生这个问题了
      

  4.   

    谢了现在加了public就行了