473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

color problem

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
3 4321
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sybren Stuvel | last post by:
Hi there! I'm a beginning Python programmer, and I like it a lot already. Since my Sharp Zaurus has a fairly complete Python environment including PyQT, I thought it would be the perfect...
5
by: Chris Beall | last post by:
I'm displaying an image that is also a link against a black background. In Netscape 7.1, the current background color is displayed as a horizontal bar below the image. This allows :hover effects...
14
by: Sheila King | last post by:
Hello, Am at my wits end, after spending quite a bit of time looking at online CSS docs, reading FAQs, searching this newsgroup and validating my CSS document. Was trying to copy, to some...
2
by: Rick Strahl [MVP] | last post by:
I seem to have problems when working with large Windows Forms files. What happens is that hte editor looses its syntax color highlighting and Intellisense capability on large files. The code works...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
10
by: tshad | last post by:
I have a problem setting the background color of textbox on the fly. I tried using: applicantID.backcolor = "F6F6F6" and applicantID.backcolor = "#F6F6F6"
36
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other...
8
by: Chad | last post by:
Should links automatically appear in the "visited" color as defined by the user's IE settings without having to add any special coding? I have a situation where the link was not changing color...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
3
by: helraizer1 | last post by:
Hey folks, yet again. if ($back == "m") //$back is a value pulled from a db; that works perfectly. { $wid = $rowing; $hei = $rowing; createthumb("660x240background2.gif", "./user/" ....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.