I needed some more attractive menu, so i thought about playing with pictureboxes, and i came up with this
also, i somewhere saw circular menu, so i thought that i would put that in too, but i ended up with 'nearly' circular menu, which is pretty okay, at least for me, because i would adjust the controls manually anyways
I made this in like 2 hours, because for me, coordinates seem to be messed up, so i had to draw on paper to visualize it to myself
Features:
When mouse enters the picturebox area, picture box enlarges for desired amount of pixels (15 by default), also, it enlarges from center, not the upper right corner of picturebox (it actually doesnt, but it looks like it does)
When picture is enlarged, it is automatically brought to front, so it can be fully seen
when mouse pointer leaves the picturebox, it goes back in it's initial state
Screenshot:
BTW. i dont want to show you all how circular menu look like, because it looks pretty bad :P, you can check it when you compile, so...
Hope this helps someone
(also, i packed up resx file by itself, as otherways it would exceedthe upload limit, so when you unpack it, just put it in your project directory where form1 is)
This is cool, but you could just make function/sub that can enlarge any picturebox, liek this:
Code:
Private Sub Enlarge(ByVal PictureBoxX As PictureBox)
GetNum()
PictureBoxX.BringToFront()
PictureBoxX.Width = (PictureBoxX.Width + enlargenum)
PictureBoxX.Height = (PictureBoxX.Height + enlargenum)
PictureBoxX.Location = New Point(PictureBoxX.Location.X - enlargenum / 2, PictureBoxX.Location.Y - enlargenum / 2)
End Sub
Here is how you use it:
Code:
Private Sub PictureBox1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
Enlarge(PictureBox1)
End Sub
Private Sub Enlarge(ByVal PictureBoxX As PictureBox)
GetNum()
PictureBoxX.BringToFront()
PictureBoxX.Width = (PictureBoxX.Width + enlargenum)
PictureBoxX.Height = (PictureBoxX.Height + enlargenum)
PictureBoxX.Location = New Point(PictureBoxX.Location.X - enlargenum / 2, PictureBoxX.Location.Y - enlargenum / 2)
End Sub
Private Sub PictureBoxEnlargement(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter, PictureBox2.MouseEnter, PictureBox3.MouseEnter, PictureBox4.MouseEnter, PictureBox5.MouseEnter, PictureBox6.MouseEnter, PictureBox7.MouseEnter
Dim SelectedPictureBox As PictureBox
If TypeOf sender Is PictureBox Then
SelectedPictureBox = DirectCast(sender, PictureBox)
Enlarge(SelectedPictureBox)
End If
End Sub
Avoid RTTI whenever you can, and remove that If TypeOf sender Is PictureBox statement. Nobody's going to call it with anything else by accident, anyways.