Solved

How to make an LED in VB 6:

Posted on 2003-11-26
2
235 Views
Last Modified: 2013-12-26
I need a LED (Green, Red) indicator in my app. What is the best way to do this? Could someone give a code example.
0
Comment
Question by:revis
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 75 total points
Comment Utility
Here is one way to do it:  Create a new project and add a new shape control.  Paste the code below and try clicking on the form.  It should alternate between red and green with each click.  Just change the size to what you need and place it where you want it to go.

Idle_Mind

Private Sub Form_Load()
    Shape1.Shape = vbShapeCircle
    Shape1.FillStyle = vbFSSolid
    Shape1.FillColor = vbGreen
End Sub

Private Sub Form_Click()
    If Shape1.FillColor = vbRed Then
        Shape1.FillColor = vbGreen
    Else
        Shape1.FillColor = vbRed
    End If
End Sub
0
 
LVL 3

Expert Comment

by:ashoooo
Comment Utility
Or use a picturebox and add an LED picture to it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now