Solved

How to make an LED in VB 6:

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 57
VB6 Compile Compatibility Issue 4 102
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 52
Send outlook email from VBS Script 2 30
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

772 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