Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将字符串转换为UI元素名称-Win 8_C#_String_Windows 8.1_Uielement - Fatal编程技术网

C# 将字符串转换为UI元素名称-Win 8

C# 将字符串转换为UI元素名称-Win 8,c#,string,windows-8.1,uielement,C#,String,Windows 8.1,Uielement,标题可能无法清楚地解释我想要实现的目标。这就是我需要的。我有一个字符串数组。有一个具有该名称的UI元素。Eg arr[0]具有Ach。有一个名为Ach的复选框 如何使用字符串Ach并将其引用到名为Ach的复选框?您可以尝试使用传递控件名称的方法作为方法参数,例如: var ach = (CheckBox)this.FindName(arr[0]); 您可以尝试使用传递控件名称的方法作为方法参数,例如: var ach = (CheckBox)this.FindName(arr[0]); 您可

标题可能无法清楚地解释我想要实现的目标。这就是我需要的。我有一个字符串数组。有一个具有该名称的UI元素。Eg arr[0]具有Ach。有一个名为Ach的复选框

如何使用字符串Ach并将其引用到名为Ach的复选框?

您可以尝试使用传递控件名称的方法作为方法参数,例如:

var ach = (CheckBox)this.FindName(arr[0]);
您可以尝试使用传递控件名称的方法作为方法参数,例如:

var ach = (CheckBox)this.FindName(arr[0]);
您可以尝试使用传递控件名称的方法作为方法参数,例如:

var ach = (CheckBox)this.FindName(arr[0]);
您可以尝试使用传递控件名称的方法作为方法参数,例如:

var ach = (CheckBox)this.FindName(arr[0]);