Click here to Skip to main content
12,633,764 members (31,101 online)
Click here to Skip to main content


39 bookmarked

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
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()

        'This call is required by the Windows Form Designer.

        '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
            End If
        End If
    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.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"
        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"
        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"
        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"
        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"
        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
        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"

    End Sub

#End Region

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

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
    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.


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


About the Author

Andelko Pavelic
Australia Australia
No Biography provided

You may also be interested in...

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