从动态文本框WP 8.1中获取价值

时间:2015-05-03 23:09:27

标签: c# wpf textbox

我已经创建了文本框,并为其添加了x:名称,但我无法获取值

创建文本框的代码:

TextBox tb = new TextBox();
var CountStackpanelNames = stackpanelNames.Children.Count + 1;
tb.Width = 360;
tb.Height = 40;
tb.FontSize = 25;
tb.Name = "TxtN" + CountStackpanelNames;
tb.Text = tb.Name;

var CountStackpanelNames = stackpanelNames.Children.Count + 1;

这会计算文本框

TextBox 1 - > X:名字 - > TxtN1

TextBox 2 - > X:名字 - > TxtN2

TextBox 2 - > X:名字 - > TxtN3 ...

enter image description here

如何通过x:names?

恢复文本框的值

0 个答案:

没有答案