473,385 Members | 1,772 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,385 software developers and data experts.

Rollover button sampel

Hello, does anyone has a simple sample of a rollover button control? I need
to asign 2 images, one for mouse enter, and otherone for mose leave. I tried
to make one, but I cant asign same images form the resources of the project
Thank you
Jun 6 '06 #1
2 2360
I think this is what you are looking for:

Public Class MyButton
Inherits System.Windows.Forms.Button

Private m_TempImage As System.Drawing.Image
Private m_MouseOverImage As System.Drawing.Image
Public Property MouseOverImage() As System.Drawing.Image
Get
Return m_MouseOverImage
End Get
Set(ByVal value As System.Drawing.Image)
m_MouseOverImage = value
End Set
End Property

Private Sub MyButton_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.MouseEnter
m_TempImage = Me.Image
Me.Image = m_MouseOverImage
End Sub

Private Sub MyButton_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.MouseLeave
Me.Image = m_TempImage
End Sub
End Class

Tony

"Manekurt" wrote:
Hello, does anyone has a simple sample of a rollover button control? I need
to asign 2 images, one for mouse enter, and otherone for mose leave. I tried
to make one, but I cant asign same images form the resources of the project
Thank you

Jun 6 '06 #2
Thank you, that worked perfect!!

Thanx! manek
"tlkerns" <tl*****@discussions.microsoft.com> escribió en el mensaje
news:74**********************************@microsof t.com...
I think this is what you are looking for:

Public Class MyButton
Inherits System.Windows.Forms.Button

Private m_TempImage As System.Drawing.Image
Private m_MouseOverImage As System.Drawing.Image
Public Property MouseOverImage() As System.Drawing.Image
Get
Return m_MouseOverImage
End Get
Set(ByVal value As System.Drawing.Image)
m_MouseOverImage = value
End Set
End Property

Private Sub MyButton_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.MouseEnter
m_TempImage = Me.Image
Me.Image = m_MouseOverImage
End Sub

Private Sub MyButton_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.MouseLeave
Me.Image = m_TempImage
End Sub
End Class

Tony

"Manekurt" wrote:
Hello, does anyone has a simple sample of a rollover button control? I
need
to asign 2 images, one for mouse enter, and otherone for mose leave. I
tried
to make one, but I cant asign same images form the resources of the
project
Thank you

Jun 6 '06 #3

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

Similar topics

5
by: Brian Angliss | last post by:
I'm relatively new to scripting in JavaScript, so I'm not too surprised I'm having difficulty scripting up an animation effect for my personal site. What I'm trying to do is the following: When...
1
by: Oxnard | last post by:
Here's the script section: function change(color){ var el=event.srcElement if (el.tagName=="INPUT"&&el.type=="button") event.srcElement.style.backgroundColor=color } function jumpto2(url){...
47
by: Lauren Quantrell | last post by:
I have constructed the following code that simulates the common rollover effect when moving the mouse over a label (this example makes the label bold.) I'm wondering if anyone has come up with...
1
by: thechaosengine | last post by:
Hi all, Can anyone tell me what I need to do to create a 3 stage rolloever button out of an asp.net image control. I don't know too much about javascript or creating user controls. I'm really...
1
by: Mike P | last post by:
what is the syntax for adding a rollover button as an image button? I have saved the button as a .swf file and put it as the ImageUrl, but since it isn't an image, do I need to save it as an image...
6
by: AJBopp | last post by:
I'm wrestling with CSS variations between Firefox and IE. I'm trying to create rollover buttons in a menu frame. It is working perfectly in Firefox but in IE only the first button is properly...
2
by: eholz1 | last post by:
Hello CSS and StyleSheet members, I have decided to move away from Dreamweaver javascript rollover buttons, in favor of a CSS type rollover button. (hope that is ok). I plan to use PHP to...
3
by: Oriane | last post by:
Hi there, I would like to handle a "rollover" <asp:Buttonin the code behind with C# with this kind of code: Button btn = Page.FindControl("Button" + numWidget) as Button; btn.Attributes =...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.