avatar
A VB Question from a beginner# DotNet - 窗口里的风景
z*n
1
I want to do something to all textboxes in a form by
the following code (e.g. add 1 to .text)
call mysub(myform)
Private Sub mysub(ByVal myContainer As Object)
Dim myControl As Control
For Each myControl In myContainer.Controls
If TypeOf myControl Is TextBox Then
'do something to mycontrol
ElseIf myControl.HasChildren Then
Call mysub(myControl)
End If
Next
End Sub
now the strange thing is all my numericalupdown controls
are also change
avatar
L*r
2
You can use spy++ to verify your assumption.
If it is true, you can try use parent of control.
By the way, if you do not implement library, I prefer a simple way to set all
textbox with same prefix name.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。