Solved

How to make an LED in VB 6:

Posted on 2003-11-26
2
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 75 total points
ID: 9825620
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
ID: 9825781
Or use a picturebox and add an LED picture to it.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month5 days, 15 hours left to enroll

626 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