Jump to content

Substituto do foreach (C#)

Recommended Posts


Como transformo o código abaixo em C# para C++.Winforms

foreach (Control control in groupBox1.Controls)


 control.Click += new EventHandler(PictureBox_Click); 


Fiz assim mas não está dando certo.

for (Control^ controle : groupBox1->controle)


    controle->Click += gcnew System::EventHandler(this, &MyForm:PictureBox_Click); 


Está dando um erro na palavra controle em negrito.



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...