可以的,需要判斷控件類滑迅型并做一肆讓頃裂陸下類型轉(zhuǎn)換。
創(chuàng)新互聯(lián)長(zhǎng)期為千余家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為無極企業(yè)提供專業(yè)的成都做網(wǎng)站、網(wǎng)站制作,無極網(wǎng)站改版等技術(shù)服務(wù)。擁有十多年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。
For Each c As Control In Me.Controls
If TypeOf(c) Is TextBox Then
Dim t As TextBox = CType(c ,TextBox)
'調(diào)用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
這段代碼可行,但不能遍歷菜單和工顫舉具欄,要按需要修改