Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

LEDClock - Windows Forms Composite Control

, 4 Jun 2002
This article explains how to build Popup editor and link it to an appropriate property in Properties Window
ledclock_demo.zip
bin
LEDClock.dll
TestLEDClock.exe
TestLEDClock.suo
TestLEDClock.vbproj.user
ledclock_src.zip
LEDClock.vbproj.user
LEDClock.suo
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents LedClock1 As WinControls.LEDClock
    Friend WithEvents btnStop As System.Windows.Forms.Button
    Friend WithEvents btnStart As System.Windows.Forms.Button
    Friend WithEvents btnReset As System.Windows.Forms.Button
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents txtSet As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.LedClock1 = New WinControls.LEDClock()
        Me.btnStop = New System.Windows.Forms.Button()
        Me.btnStart = New System.Windows.Forms.Button()
        Me.btnReset = New System.Windows.Forms.Button()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.txtSet = New System.Windows.Forms.TextBox()
        Me.SuspendLayout()
        '
        'LedClock1
        '
        Me.LedClock1.BackColor = System.Drawing.SystemColors.Control
        Me.LedClock1.ForeColor = System.Drawing.Color.SteelBlue
        Me.LedClock1.Location = New System.Drawing.Point(136, 56)
        Me.LedClock1.Name = "LedClock1"
        Me.LedClock1.Size = New System.Drawing.Size(256, 32)
        Me.LedClock1.TabIndex = 0
        Me.LedClock1.Time = "08:56:55"
        '
        'btnStop
        '
        Me.btnStop.BackColor = System.Drawing.SystemColors.Control
        Me.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnStop.ForeColor = System.Drawing.Color.SteelBlue
        Me.btnStop.Location = New System.Drawing.Point(16, 16)
        Me.btnStop.Name = "btnStop"
        Me.btnStop.Size = New System.Drawing.Size(488, 23)
        Me.btnStop.TabIndex = 1
        Me.btnStop.Text = "Stop clock"
        '
        'btnStart
        '
        Me.btnStart.BackColor = System.Drawing.SystemColors.Control
        Me.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnStart.ForeColor = System.Drawing.Color.SteelBlue
        Me.btnStart.Location = New System.Drawing.Point(16, 112)
        Me.btnStart.Name = "btnStart"
        Me.btnStart.Size = New System.Drawing.Size(488, 23)
        Me.btnStart.TabIndex = 1
        Me.btnStart.Text = "Start clock"
        '
        'btnReset
        '
        Me.btnReset.BackColor = System.Drawing.SystemColors.Control
        Me.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnReset.ForeColor = System.Drawing.Color.SteelBlue
        Me.btnReset.Location = New System.Drawing.Point(16, 48)
        Me.btnReset.Name = "btnReset"
        Me.btnReset.Size = New System.Drawing.Size(88, 56)
        Me.btnReset.TabIndex = 1
        Me.btnReset.Text = "Reset time"
        '
        'Button1
        '
        Me.Button1.BackColor = System.Drawing.SystemColors.Control
        Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.Button1.ForeColor = System.Drawing.Color.SteelBlue
        Me.Button1.Location = New System.Drawing.Point(416, 48)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(88, 40)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "Set time"
        '
        'txtSet
        '
        Me.txtSet.BackColor = System.Drawing.SystemColors.Window
        Me.txtSet.Location = New System.Drawing.Point(416, 88)
        Me.txtSet.Name = "txtSet"
        Me.txtSet.Size = New System.Drawing.Size(88, 20)
        Me.txtSet.TabIndex = 2
        Me.txtSet.Text = ""
        Me.txtSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(520, 149)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtSet, Me.btnStop, Me.LedClock1, Me.btnStart, Me.btnReset, Me.Button1})
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
        Me.LedClock1.Stop()
    End Sub

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        Me.LedClock1.Start()
    End Sub

    Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
        Me.LedClock1.Time = "00:00:00"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.LedClock1.Time = Me.txtSet.Text
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Andelko Pavelic

Australia Australia
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 5 Jun 2002
Article Copyright 2002 by Andelko Pavelic
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid