color problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new to VB and I am creating a simple calculator for practice. I am using
VB .Net
I want button's background color to change when mouse hover over it but VB
keep tell me that Name 'color' is not declared.
following is the code
Private Sub plus_button_MouseHover(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles plus_button.MouseHover
plus_button.BackColor = Color.Blue
End Sub
 
cyzpro said:
I am new to VB and I am creating a simple calculator for practice. I am
using
VB .Net
I want button's background color to change when mouse hover over it but VB
keep tell me that Name 'color' is not declared.
following is the code
Private Sub plus_button_MouseHover(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles plus_button.MouseHover
plus_button.BackColor = Color.Blue

Make sure the file containing the VB.NET code contains the line 'Imports
System.Drawing' at the beginning.
 
I am not sure where "beginning of the file" is. Do you mean at private sub
form1_load? I entered Imports System.Drawing in private sub form1_load and it
showed syntax error.
 
cyzpro said:
I am not sure where "beginning of the file" is. Do you mean at private sub
form1_load? I entered Imports System.Drawing in private sub form1_load and
it
showed syntax error.

It's on top of the file, above all type declarations and definitions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top