텍스트 상자가 포함 된 그룹 상자가 있고이 상자를 모두 ReadOnly = True로 설정하려고합니다. 여기 (작동하지 않습니다) 내가 뭘하려 :루프 - 모든 그룹 상자에서 텍스트 상자를 ReadOnly로 설정
For Each SplitCon As Control In Me.Controls
If TypeOf SplitCon Is SplitContainer Then
For Each GBox As Control In SplitCon.Controls
If TypeOf GBox Is GroupBox Then
For Each ctrl As Control In GBox.Controls
If TypeOf (ctrl) Is TextBox Then
CType(ctrl, TextBox).ReadOnly = True
End If
Next
End If
Next
End If
Next
오류가 있습니까? 디버거에서 코드를 밟아 'For Each GBox As Control in Me.Controls'에서 얻은 것을 확인 했습니까? – Tim
나는 어떤 오류도 내지 않으며 아무 것도하지 않는다. – LuckyLuke82
그룹 상자는 패널과 같은 다른 컨테이너 안에 있거나 폼 위에 있습니다. –