iItem nItem = new iItem("abc");//数据源,text是它的属性PictrueBox box = new PictrueBox(); //控件box.DataBindings.Add(new System.Windows.Forms.Binding("Name", nItem, "text", true));怎么没有绑定好啊?请问为什么?谢谢
解决方案 »
- VS2012安装失败
- 用webbrowser怎么模拟webbrowser里面的flash的点击事件
- System.Net.Sockets 类还是在调用 winsock.dll 吗?
- 请叫一个问题
- 一个地区选择的问题
- c# 能否固定form的高度,比如说1012高,怎么拉滚动条最大就到1012!
- 各位哥哥姐姐小弟有些问题大家帮忙解答一下好吗?——在线等 急急!!
- 请教:我用OpenText();打开一个文件,调试时发现显示的汉字是乱码,所以找不到我所需要的(@"路径1 =") 字符串。
- 有朋友在用MySql开发。Net数据库程序吗?用Mysql有Ms sql快吗??
- VSIDE环境不稳定?
- 关于DATAGRID操作问题,急急急!
- framework 1.1 升级到2.0 的问题
class iItem
{
private string textname;
public iItem(string tt)
{
text = tt;
}
public string text
{
get { return textname; }
set { textname = value; }
}}
PictureBox box = new PictureBox();
this.Controls.Add(box);
box.DataBindings.Add(new System.Windows.Forms.Binding("Name", nItem, "text", true));
//测试一下
this.textBox1.Text = box .Name;
this.Controls.Add(box);
box.DataBindings.Add("Name", nItem, "text", true);
就这样的代码,如果有用的话,box.Name应该是有值得,可是调试到后面,还是空
PictureBox box = new PictureBox();
this.Controls.Add(box);
box.DataBindings.Add(new System.Windows.Forms.Binding("Name", nItem, "text", true));
//测试一下
this.textBox1.Text = box .Name;