c# 自定义控件问题

faipo 2012-05-03 06:16:59
我新增了一个自定义控件是一个BUTTON然后在这BUTTON里加了三个属性分别是fid,fcod,fdest系统自动生成的代码为:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace zb
{
public partial class UC : UserControl
{
public UC()
{
InitializeComponent();
}

/// <value></value>
public string fid
{
get
{
throw new System.NotImplementedException();

}
set
{

}
}

public string fcod
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}

public string fdes
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}

private void button1_Click(object sender, EventArgs e)
{

}
}
}


我在另外一个FORM中添加了uc1.fid = MyDataSet.Tables[0].Rows[0]["fid"].ToString();进行赋值


当我想用MessageBox.Show(uc1.fid );显示出值来时老是出错提示 : 未处理NotImplementedException
未实现该方法或操作
MyDataSet.Tables[0].Rows[0]["fid"].ToString()的值是1已经在另一个按钮的TEXT里显示出来了
请问我这是里里出问题了?
...全文
174 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hrandllg 2013-03-06
  • 打赏
  • 举报
回复
可是里面没办法是用public啊?
faipo 2012-05-03
  • 打赏
  • 举报
回复
俺是新手真是太感谢你了
Rotaxe 2012-05-03
  • 打赏
  • 举报
回复
把自动生成的代码
throw new System.NotImplementedException();去掉
改成
public string fid{get;set;}

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧