473,405 Members | 2,334 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,405 software developers and data experts.

How to change onmouseover and onmouseout dynamically

Hi, I control the style of a button like the code below

Private Sub Change_Color()
Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
Button1.Style("COLOR") = "White"
End Sub

How can I do the same with Button1's onmouseover and onmouseout style?

(Language VB.NET)

T.I.Rislaa

Nov 17 '05 #1
3 2713
Tor,

Button1.Attributes.Add("onmouseover",
"javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';"
)

Button1.Attributes.Add("onmouseout", "javascript: ... ;")

Should do it for you.

(I'm not positive I've specified the styles properly. I'm borrowing the
format from a cursor change that I do:
"javascript:this.style.cursor='pointer';" but I'm pretty sure it will work.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi, I control the style of a button like the code below

Private Sub Change_Color()
Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
Button1.Style("COLOR") = "White"
End Sub

How can I do the same with Button1's onmouseover and onmouseout style?

(Language VB.NET)

T.I.Rislaa

Nov 17 '05 #2
You don't want the "javascript:" unless you're putting the code into the
href attribute of an anchor tag. Just add "this.style.color...".
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Tor,

Button1.Attributes.Add("onmouseover",
"javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';" )

Button1.Attributes.Add("onmouseout", "javascript: ... ;")

Should do it for you.

(I'm not positive I've specified the styles properly. I'm borrowing the
format from a cursor change that I do:
"javascript:this.style.cursor='pointer';" but I'm pretty sure it will work.
Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi, I control the style of a button like the code below

Private Sub Change_Color()
Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
Button1.Style("COLOR") = "White"
End Sub

How can I do the same with Button1's onmouseover and onmouseout style?

(Language VB.NET)

T.I.Rislaa


Nov 17 '05 #3
And remember to set Content-Script-Type, either in HTTP headers or through a
META tag...

Jerry

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
You don't want the "javascript:" unless you're putting the code into the
href attribute of an anchor tag. Just add "this.style.color...".
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Tor,

Button1.Attributes.Add("onmouseover",

"javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';"
)

Button1.Attributes.Add("onmouseout", "javascript: ... ;")

Should do it for you.

(I'm not positive I've specified the styles properly. I'm borrowing the
format from a cursor change that I do:
"javascript:this.style.cursor='pointer';" but I'm pretty sure it will

work.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi, I control the style of a button like the code below

Private Sub Change_Color()
Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
Button1.Style("COLOR") = "White"
End Sub

How can I do the same with Button1's onmouseover and onmouseout style?

(Language VB.NET)

T.I.Rislaa



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: laurie | last post by:
Hi. I have a DIV section that has many thumbnail images inside it. I have a DIV so all images can fit in a row and the horizontal scroll bar is used to move the thumbnails from left to right. ...
2
by: Raigo | last post by:
There is a bug with IE6 handling Javascript onMouseOver and onMouseOut events. Can it be replaced somehow with CSS? For example when I want to change images when user moves mouse to certain HTML...
3
by: bigoxygen | last post by:
Hi. I have a list that is similar to this: -Evaluation +test +test -Students +test I would like to change the "-" bullet only, but I cannot. My
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
16
by: Giggle Girl | last post by:
Hi there, I have a nav tree similar to the XP Windows Explorer in behavior. It uses styles to underline a row on mouseover, and change the look of a row when clicked. Currently, it is working...
2
by: Steve Macleod | last post by:
Hi, I was wondering if anyone would be good enough to have a look at the following code and tell me if there is something im missing! drug_list is an array of drug details table is a reference to...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change?...
1
by: sueian | last post by:
can some1 help with this code. can i add in a function like on click. when user click one of the link. the color will change to static from mouse over color. the text need to highligted after click....
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.