Dim p_country As WinForm.picturebox = e.Form.Controls("Pb_国家")
Dim countrylist As String = ""
For Each c As WinForm.PictureBox In p_country.children
countrylist = countrylist & "," & c.Name
Next
红色的部分编译没问题,但完全没有执行
Dim fm As WinForm.Form = forms(args(0)) '窗口名
Dim PName As String = args(1) 'picturebox名
Dim pa As WinForm.PictureBox= fm.Controls(PName)
Dim pbx As WinForm.PictureBox
For Each p As String In ps
pbx = fm.CreateControl(p, ControlTypeEnum.PictureBox)
pa.AddControl(pbx)
pbx.ToolTip = p
pbx.Width = 53
pbx.Height = 39
pbx.Left = x
pbx.Top = y
If p <> "" Then
pbx.ImageFile = p & ".png"
Else
pbx.ImageFile = "问号.png"
End If
pbx.SizeMode = ImageSizeMode.Zoom
x = x + 60
If x+60 > pa.Width Then
x = 2
y = y + 42
End If
Next
应该是bug,我反馈一下
临时先换种用法
Dim p_country As WinForm.picturebox = e.Form.Controls("Pb_国家")
For Each c As Object In p_country.BaseControl.Controls(0).Controls
msgbox(c.Name)
Next