Solved

How to make an LED in VB 6:

Posted on 2003-11-26
2
249 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 85

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

756 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