Solved

Visual Studio Visual Basic Button

Posted on 2007-03-23
1
203 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

758 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

25 Experts available now in Live!

Get 1:1 Help Now