私はテキストボックスを含むグループボックスを持っており、それらをすべてReadOnly = Trueに設定します。ここで私は(動作しない)しようとしたものです:すべてのグループボックスでテキストボックスをReadOnlyにループ設定します
EDIT(私はスプリットコンテナを忘れてしまった):
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
あなたのグループボックスは、パネルのような他のコンテナの中やフォームの上に座っていますか? –