Solved

Visual Studio Visual Basic Button

Posted on 2007-03-23
1
243 Views
Last Modified: 2013-11-26
Have a button

BottonName: Testbutton
FlatStyle: Flat


That can't been seen --until the curser is on it---- turns to a darker color
Is thier a way to test the conditions

If  Textfields below
Advvariance=0            
Guestvariance=0
Cityvariance=0
and
SettlementDatetxt = current system date

Is their a way ------
When the cursor is on the button for it to be the color green if those conditions pass
and what event for the botton would it be?

Thanks
JK


0
Comment
Question by:fsuedu
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18782420
Use the MouseEnter()/MouseLeave() events:

    Private Sub Testbutton_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Testbutton.MouseEnter
        Testbutton.Tag = Testbutton.BackColor ' store the current color

        If someCondition Then
            Testbutton.BackColor = Color.Green
        Else
            Testbutton.BackColor = Color.Red
        End If
    End Sub

    Private Sub Testbutton_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Testbutton.MouseLeave
        Testbutton.BackColor = Testbutton.Tag ' restore the original color
    End Sub
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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