大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
可以的,需要判断控件类滑迅型并做一肆让顷裂陆下类型转换。
创新互联长期为千余家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为无极企业提供专业的成都做网站、网站制作,无极网站改版等技术服务。拥有十多年丰富建站经验和众多成功案例,为您定制开发。
For Each c As Control In Me.Controls
If TypeOf(c) Is TextBox Then
Dim t As TextBox = CType(c ,TextBox)
'调用t的方法即可
End If
Next
For Each i As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses
Next
Private Sub 槐枣Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
Dim TheTypes As Type() = myAssembly.GetTypes()
Dim myType As Type
宽羡 For Each myType In TheTypes
If myType.BaseType.ToString = "System.Windows.Forms.Form" Then
慎明拍 ListBox1.Items.Add(myType.Name)
End If
Next
End Sub
Public Sub GetAllControls(ByVal InContainer As Control, ByRef RecieveList As ListBox)
For i As Integer = 0 To InContainer.Controls.Count - 1
If InContainer.Controls.Item(i).Text "" Then
GetList.Items.Add(InContainer.Controls.Item(i).Text vbCrLf)
End If
侍绝 If InContainer.Controls.Item(i).Controls.Count 0 Then
GetAllControls(InContainer.Controls.Item(i), 茄谈碧GetList)
End If
Next
End Sub
这段代码可行,但不能遍历菜单和工颤举具栏,要按需要修改