All pastes #772667 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-13 23:26 UTC
rendered paste body
Public Class Form1
    Dim time, bin As String
    Dim x, den, y, z, vis(1) As Integer
    Dim c, d As Object
    Sub rofl()
        time = TimeString.Replace(":", "")
        For x = 0 To 5
            den = Val(time(x))
            For Each c In Me.Controls
                If c.Name = "n" & x & "p0" Then
                    c.Text = den
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "n" & x & "p1" Then
                    If den = 0 Then
                        bin = "0000"
                    End If
                    Do Until den = 0
                        y = den Mod 2
                        den = den \ 2
                        bin = y & bin
                    Loop
                    Do Until bin.Length = 4
                        bin = 0 & bin
                    Loop
                    c.Text = bin
                    bin = ""
                End If
            Next
        Next
        For x = 0 To 3
            For Each c In Me.Controls
                If c.Name = "rdhr" & x & "p0" Then
                    If n0p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "rdhr" & x & "p1" Then
                    If n1p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "rdm" & x & "p0" Then
                    If n2p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "rdm" & x & "p1" Then
                    If n3p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "rds" & x & "p0" Then
                    If n4p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
            For Each c In Me.Controls
                If c.Name = "rds" & x & "p1" Then
                    If n5p1.Text(x) = "1" Then
                        c.Checked = True
                    Else
                        c.checked = False
                    End If
                End If
            Next
        Next
    End Sub

    Private Sub tmr_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr.Tick
        If Me.Text = "binary clock_" Then
            Me.Text = "binary clock"
        Else
            Me.Text = "binary clock_"
        End If
        rofl()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        rofl()
    End Sub

    Private Sub btnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnd.Click
        If vis(0)=0 Then
            vis(0)=1
            For x = 0 To 5
                Me.Controls("n" & x & "p0").Visible=True
            Next
        Else
            vis(0)=0
            For x = 0 To 5
                Me.Controls("n" & x & "p0").Visible=False
            Next
        End if
    End Sub

    Private Sub btnb_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnb.Click
        If vis(1)=0 Then
            vis(1)=1
            For x = 0 To 5
                Me.Controls("n" & x & "p1").Visible=True
            Next
        Else
            vis(1)=0
            For x = 0 To 5
                Me.Controls("n" & x & "p1").Visible=False
            Next
    End Sub

End Class