pluMmet Posted November 25, 2003 Posted November 25, 2003 How (if possible) do I make a separate image appear when the mouse is over a button and another image when the button is clicked...so that's total of three images on a button (counting an original image.) thx- Eric Quote
bpayne111 Posted November 25, 2003 Posted November 25, 2003 one trick i used one time was hide the real cursor and created my own using transparency and my own images. it takes some work but the final product is great. you may need to use the Form.SetStyle method to keep the form from flickering. i hope that helps brandon Quote i'm not lazy i'm just resting before i get tired.
pluMmet Posted November 25, 2003 Author Posted November 25, 2003 bpayne111- thanks for the response...It sounds like your talking about the cursor changing images. I'm refering to the button images. I know there's a .hover type event that could be usefull for the second image of the button. And I have no info on the image used for the click operation maybe .click or something? I do however need a little detail (a few lines of code)...I'm just getting back to programing after years away from my comodore64, TRS-80 and Atari 800 days. I knew how to program on those very well but I'm just getting used to not using line numbers (which is a bit odd for me.) So think of me as a newbe :( Quote
Leaders dynamic_sysop Posted November 25, 2003 Leaders Posted November 25, 2003 you could tell it that it's default image matches the Mouse_Up image , then add an image for Mouse_Enter , an image for Mouse_Down, then on Mouse_Leave set the image back to the default image. Quote
pluMmet Posted November 25, 2003 Author Posted November 25, 2003 So... Mouse_Up image, Mouse_Enter and Mouse_Down can be set to activate only when over the button? Quote
pluMmet Posted November 25, 2003 Author Posted November 25, 2003 Like i say, I'm new to this but does this look remotely close to any one: If Me.Button1 = Inherits System.Windows.Forms.Button.MouseHover then <points to new button Image> or If Me.Button1 = New System.Windows.Forms.Button.MouseHover then <points to new button Image> Quote
Leaders dynamic_sysop Posted November 25, 2003 Leaders Posted November 25, 2003 like this.... Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button3.Image = Image.FromFile("C:\Image3.jpg") End Sub Private Sub Button3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.MouseEnter Button3.Image = Image.FromFile("C:\Image1.jpg") End Sub Private Sub Button3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button3.MouseDown Button3.Image = Image.FromFile("C:\Image2.jpg") End Sub Private Sub Button3_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.MouseLeave Button3.Image = Image.FromFile("C:\Image3.jpg") End Sub Quote
pluMmet Posted November 25, 2003 Author Posted November 25, 2003 dynamic_sysop-you rock! thx...everything's going smoothly, I got my .net books in the mail. I'm sure I'll be up to speed in no time. Just a little note: I've seen 3 different ways to call up a form from a button on another form. People make things so hard. My sams teach yourself vb.net in 21 days made it the easiest :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.