" La cláusula Handles requiere una variable WithEvents definida en el tipo contenedor o en uno de sus tipos base "
No se si es porque hago el form pongo los controles pero pongo el codigo despues ?
Código
Public Class Form1 Private TextBoxes As TextBox() = {Nothing} Private Result1 As Int32(), Result2 As Int32() ReadOnly Property Num1 As Int32 Get Return CInt(TextBox1.Text) End Get End Property ReadOnly Property Num2 As Int32 Get Return CInt(TextBox2.Text) End Get End Property Private Sub Sumar(sender As Object, e As EventArgs) _ Handles Button_Sum.Click Dim TextBoxCount As Short = -1 TextBoxes = {TextBox3, TextBox4, TextBox5, TextBox6} Result1 = {Num1 + 15, Num1 + 25} _ .Distinct().ToArray ' Elimino duplicados Result2 = {Num2 + 30, Num2 + 20} _ .Distinct().ToArray ' Elimino duplicados Array.Sort(Result1) : Array.Sort(Result2) ' Ordeno los Items For Each Number As Int32 In Result1 TextBoxCount += 1 TextBoxes(TextBoxCount).Text = Number Next For Each Number As Int32 In Result2 TextBoxCount += 1 TextBoxes(TextBoxCount).Text = Number Next End Sub End Class
Luis