Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15571

Tab Page control inside a thread

$
0
0
Hello,

I have been trying to switch between the tab pages inside a background running thread. Below I have attached a snippet of my thread code and If the value of i becomes 5 the tab page should be switched to another one automatically, but I don't know how this should be done. Can someone please help me with this?

Code:

For i= 0 To CInt(ARMNUMBER)+3
    If Quit Then
        Exit Sub
    End If
    Select Case i
        Case 0
            BlinkAB1 = True

        Case 1
            BlinkAB1 = False
            If confirm Then
                pbAB1.Image = iLAB1.Images(1)
            Else
                pbAB1.Image = iLAB1.Images(0)
            End If       
            BlinkAB2 = True

        Case 2
            BlinkAB2 = False
            If confirm Then
                pbAB2.Image = iLAB2.Images(1)
            Else
                pbAB2.Image = iLAB2.Images(0)
            End If
            BlinkAB3 = True

        Case 3
            BlinkAB3 = False
            If confirm Then
                pbAB3.Image = iLAB3New.Images(1)
            Else
                pbAB3.Image = iLAB3New.Images(0)
            End If
            BlinkAB4 = True

        Case 4
            BlinkAB4 = False
            If confirm Then
                pbAB4.Image = iLAB4.Images(1)
            Else
                pbAB4.Image = iLAB4.Images(0)
            End If
            BlinkArm1 = True

        Case 5
            Me.tabControlGUI.SelectedIndex = 1  'Tab page changing process should be implemented here. This is what I have tried but it shows some error

            BlinkArm1 = False
            If confirm Then
                pbARM1.Image = iLARM1.Images(1)
            Else
                pbARM1.Image = iLARM1.Images(0)
            End If
            BlinkArm2 = True

        Case 6
            BlinkArm2 = False
            If confirm Then
                pbARM2.Image = iLARM2.Images(1)
            Else
                pbARM2.Image = iLARM2.Images(0)
            End If
            BlinkArm3 = True

        Case 7
            BlinkArm3 = False
            If confirm Then
                pbARM3.Image = iLARM3.Images(1)
            Else
                pbARM3.Image = iLARM3.Images(0)
            End If
            BlinkArm4 = True   

        Case 8
                BlinkArm4 = False
                If confirm Then
                    pbARM4.Image = iLARM4.Images(1)
                Else
                    pbARM4.Image = iLARM4.Images(0)
                End If
            BlinkArm5 = True
    End Select

  ' --------------------- some more code--------------------
Next


Viewing all articles
Browse latest Browse all 15571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>