Jump to content

Como Substituir o valor numérico do control Panel? pelo valor X do ciclo For


Chamuanza

Recommended Posts

Um Bem Aja a Todos

Tenho este código e não sei como substituir o valor numérico do control  Panel? pelo valor X do ciclo For

 Dim ctrl As Control

        For X As Integer = 1 To 10 Step 3

            For Each ctrl In Panel?.Controls

                If TypeOf (ctrl) Is Label Then
                    If ctrl.BackColor = Color.Yellow Then
                        MsgBox("TESTE")

                        RadioButton3.Checked = True

                        Exit For

                    End If


                End If
            Next


        Next

Agradeço desde já a atenção

Link to comment
Share on other sites

Boas

O que pretendes pode ser feito assim

Dim ctrl As Control

For X As Integer = 1 To 10 Step 3
	Dim nome_painel As Panel = CType(Me.Controls("Panel" + X.ToString()), Panel)
  
	For Each ctrl In nome_painel.Controls
		If TypeOf (ctrl) Is Label Then
			If ctrl.BackColor = Color.Yellow Then
				MsgBox("TESTE")
				RadioButton3.Checked = True
				Exit For
			End If
		End If
	Next
Next


        Next

A informática chegou para resolver problemas que antes não existiam

Quem ri por último é porque está conectado a 52 Kbs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.