wpf中textBox绑定list<string>显示
            代码如下:
                    List<string> list = new List<string>() { "tim", "tom", "mom" };
        txb1.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list });
        txb2.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list });
        txb3.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list });
                    如何让textbox通过绑定显示变成
                    ![图片说明](https://img-ask.csdn.net/upload/201512/28/1451289360_148951.png)这个样子,求教!

1个回答

txb1.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list[0] });
txb2.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list[1] });
txb3.SetBinding(TextBox.TextProperty, new Binding("/") { Source = list[2] });

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问