Andrew Parsons has some pretty big shoes to fill at his company. Among many other revolutionary inventions, his predecessor single-handedly developed one of most innovative GUI elements ever seen: the Click2. What's so incredible about this is that it adds an entire dimension to selection via a computer mouse: if a user clicks one time ("Click") a different action is performed than if she clicks two times ("Click2"). Following is the (VB6) machinery behind this astonishing creation ...

Private Sub lblSetText_Click()
    
    'Click twice if already clicked
    If tmrClickTimer.Tag = "1.lblSetText" Then
        tmrClickTimer.Tag = "2.lblSetText"
    Else
        tmrClickTimer.Tag = "1.lblSetText"
    End If
    
End Sub

'Ed: SNIP

Private Sub tmrClickTimer_Timer()

    'Only function while arguments exist
    If tmrClickTimer.Tag = "" Then Exit Sub

    'Extract the Timer args
    Dim aryArgs() As String
    aryArgs = Split(tmrClickTimer.Tag, ".")
    
    'Find number of times clicked
    Select Case aryArgs(0)
        Case "1"
            'Determine which function to call
            Select Case aryArgs(1)
                Case "cmdLoadFile"
                    Call cmdLoadFile_Click
                
                'ED: Snip
                
                Case "cmdSaveItem"
                    Call cmdSaveItem_Click
                Case Else
                    'MsgBox "Unknown Button: " & aryArgs(1)
            End Select
        Case "2"
            'Determine which function to call
            Select Case aryArgs(1)
                Case "selSelectCar"
                    Call selSelectCar_Click2
                
                'ED: Snip
                
                Case "imgCompleteTrans"
                    Call imgCompleteTrans_Click2
                Case Else
                    'MsgBox "Unknown Button: " & aryArgs(1)
            End Select
    End Select
    
    'Clear the tag
    tmrClickTimer.Tag = ""

End Sub

Last Andrew heard, his predecessor was busy litigating over a certain company stealing his idea ...

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!