Hi,

I recently upgraded my application from VB6 to VB 2008. It seems that the checkbox array isn't able to be used.

When I try to create a new checkbox array by copy paste, the new pasted checkbox isn't arrayed with the existing checkboxes.

I need to know how to fix the problem or create checkbox arrays in VB 2008 (.Net).

Thanks

These are the two sub where the above .bmp images occur. The line is marked with *.

Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click

        Dim x As Short
        Dim temp(10, 4) As String
        Dim laluan As Short

        'On Error GoTo errorC3
        caruman_error()
        If errorcaruman = True Then
            errorcaruman = False
            Exit Sub
        End If
        laluan = 1
        caruman(bilcaruman, 0) = CDbl(Combo1.Text)
        caruman(bilcaruman, 1) = CDbl(Combo2.Text)
        caruman(bilcaruman, 2) = CDbl(Combo10.Text)
        caruman(bilcaruman, 3) = 5
        While laluan < 10
            For x = 0 To 8
                If caruman(x, 2) < caruman(x + 1, 2) Then
                    temp(x, 3) = CStr(caruman(x, 3))
                    temp(x, 2) = CStr(caruman(x, 2))
                    temp(x, 1) = CStr(caruman(x, 1))
                    temp(x, 0) = CStr(caruman(x, 0))
                    caruman(x, 3) = caruman(x + 1, 3)
                    caruman(x, 2) = caruman(x + 1, 2)
                    caruman(x, 1) = caruman(x + 1, 1)
                    caruman(x, 0) = caruman(x + 1, 0)
                    caruman(x + 1, 3) = CDbl(temp(x, 3))
                    caruman(x + 1, 2) = CDbl(temp(x, 2))
                    caruman(x + 1, 1) = CDbl(temp(x, 1))
                    caruman(x + 1, 0) = CDbl(temp(x, 0))
                End If
            Next x
            laluan = laluan + 1
        End While
        For x = 0 To bilcaruman
            Debug.Print("a" & caruman(x, 0) & "b" & caruman(x, 1) & "c" & caruman(x, 2))
*            Check1(x).Text = caruman(x, 2) & ", E'yee: " & caruman(x, 0) & "%, E'yer: " & caruman(x, 1) & "%"
        Next x
        bilcaruman = bilcaruman + 1
        If bilcaruman > 9 Then Command3.Enabled = False

errorC3:
        Exit Sub

    End Sub
    Private Sub Command4_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command4.Click

        Dim laluan, x As Object
        Dim y As Short

        For x = 0 To bilcaruman - 1
            If Check1(x).CheckState Then
                Check1(x).Text = ""
                For y = 0 To 3
                    caruman(x, y) = 0
                Next y
                Check1(x).CheckState = False
                bilcaruman = bilcaruman - 1
            End If
        Next x
        laluan = 1
        While laluan < 10
            For y = 0 To 8
                *If Check1(y).Text = "" Then
                    Check1(y).Text = Check1(y + 1).Text
                    Check1(y + 1).Text = ""
                    For x = 0 To 3
                        caruman(y, x) = caruman(y + 1, x)
                        caruman(y + 1, x) = 0
                    Next x
                End If
            Next y
            laluan = laluan + 1
        End While
        If bilcaruman < 10 Then Command3.Enabled = True

    End Sub

Edited 5 Years Ago by Nick Evan: Added CODE tags

This article has been dead for over six months. Start a new discussion instead.