Hack Forums
[.NET] [Short TUT] Making a rollover button that flashes [Short TUT] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Short TUT] Making a rollover button that flashes [Short TUT] (/showthread.php?tid=300259)



[Short TUT] Making a rollover button that flashes [Short TUT] - Nezami - Mar 5, 2010

Hi guys I am going to show you how to make a rollover button that flashes when you rollover it.

To start with you will need 2 images.
- Don't HAVE to be same size but it looks better
- Prefibly the same image, E.G A blue question mark and then a red question mark

So once you have your 2 images, I'm going to use 2 question marks from RuneScape, open up VB and make a new project and then add 2 "Picture boxes"

[IMG]http://i48.[censored].com/20qakxf.jpg[/IMG]

Now once you have done that, go to the one you want to show SECOND and go to properites then scroll down to "visible" and set as "false"

[IMG]http://i48.[censored].com/182bs1.jpg[/IMG]

Now, double click the first picture box (the one that is visible at the start) and then go to the top right and select "MouseMove"

[IMG]http://i47.[censored].com/343rlgp.jpg[/IMG]

Now type in this code
Code
PictureBox2.Visible = False
        PictureBox1.Visible = True

Ofcourse replace the "picturebox2" and "picturebox1" with which ones you want.

[IMG]http://i48.[censored].com/29xjhv8.jpg[/IMG]

Now once you have done that, go back onto your form and double click the OTHER button, the one that appears after rolling over the first one, and go to the top right again and select "MouseLeave" and put this code

Code
picturebox1.visible = false
picturebox2.visible = true

[IMG]http://i47.[censored].com/2qwki0k.jpg[/IMG]

And that's it! To make the buttons better, put one on top of the other then it will look like it flashes rather then a different image appearing.


Credits
------------------------------------
%90 to me for making the tutorial
%10 to DarkZero for making THISprogram which made me make the tut.
More tutorials
------------------------------------
Runescape free pin methods - 6 methods
How to upload videos to YouTube (Some ppl don't know)
How to generate random numbers on VB (to make fake keygens etc)


* - Shu7down - Mar 5, 2010

Nice... It is nice ;)


* - Nezami - Mar 5, 2010

(Mar 5, 2010 04:11 PM)ShuTdown Wrote:  Nice... It is nice ;)

Thanks for posting :D


* - Deathader - Mar 5, 2010

It's better to use a single picturebox and rotate the images from the resources. It's less messy.


* - Nezami - Mar 5, 2010

(Mar 5, 2010 04:25 PM)Deathader Wrote:  It's better to use a single picturebox and rotate the images from the resources. It's less messy.

Can you please show me the source? Im new at VB as well xD


* - phyyyyy - Mar 5, 2010

Far from a TUT, i didnt learn jack shit except how to copy and past crap.

but, i would of done it like the other dude stated, and simply use the "Mouse Enter" & "Mouse Leave" events.

Code
Sub ME handles picturebox1.mouseenter
picturebox1.image = my.resources.image2
end sub

Sub ML handles picturebox1.mouseLeave
picturebox1.image = my.resources.image1
end sub



* - Nezami - Mar 5, 2010

(Mar 5, 2010 05:04 PM)phyyyyy Wrote:  Far from a TUT, i didnt learn jack shit except how to copy and past crap.

but, i would of done it like the other dude stated, and simply use the "Mouse Enter" & "Mouse Leave" events.

Code
Sub ME handles picturebox1.mouseenter
picturebox1.image = my.resources.image2
end sub

Sub ML handles picturebox1.mouseLeave
picturebox1.image = my.resources.image1
end sub

Well maybe you shouldn't just copy and paste shit and actually read the code yeah?


* - «*0riGinz*» - Mar 6, 2010

Very, Very nice and short, I never new this could be done!

Well done mate.


* - Incomplete - Mar 6, 2010

I have this in my tut. And much more!

But, still nice none the less.


* - Nezami - Mar 6, 2010

Thanks for feedback guys :D