Solved

Visual Studio Visual Basic Button

Posted on 2007-03-23
1
256 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
[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
1 Comment
 
LVL 86

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

622 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