By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

color problem

P: n/a
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

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"cyzpro" <cy****@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
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.


"Herfried K. Wagner [MVP]" wrote:
"cyzpro" <cy****@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
"cyzpro" <cy****@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.