我已经创建了文本框,并为其添加了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 ...
如何通过x:names?
恢复文本框的值