0
我试图Double Click
在Label
在FlowLayoutPanel
,标签是动态创建的。 Im试图用此打开表格在标签上打开表单双击流程布局面板内
foreach(Label label in myFlp)
{
var Id = label.Name.ToString();
int personID;
if (!String.IsNullOrWhiteSpace(Id) && int.TryParse(Id, out personID))
{
FrmAddress frmAddress = new FrmAddress(_controller, personID);
frmAddress.ShowDialog();
frmAddress.Dispose();
}
}
获取此错误;
foreach statement cannot operate on variables of type 'System.Windows.Forms.FlowLayoutPanel' because 'System.Windows.Forms.FlowLayoutPanel' does not contain a public definition for 'GetEnumerator'
谢谢,我把一个断点在该行'如果(String.IsNullOrWhiteSpace(同上)&& int.TryParse(ID,出PERSONID)!)',我认为这条线是问题? – AndroidAL
该线接缝正确不认为这是问题。 – Johannes
当我只是调用'if(控件是标签)'的形式,它的工作原理没有传递任何变量? – AndroidAL