Results 1 to 6 of 6

Thread: 'Animated' Menu

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2009
    Location
    Croatia
    Posts
    201

    'Animated' Menu

    Hi!

    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)
    Attached Files Attached Files

  2. #2
    Hyperactive Member Trusted's Avatar
    Join Date
    Jun 2010
    Location
    Don't Know, Cause, I am a Newbie :P
    Posts
    269

    Re: 'Animated' Menu

    Thanks Erco,

    It is great really! I hope you can improve it more cause there are lot of ways to improve it and also add colors to it.

    Still excellent work. Simple and cute

    Trusted




    <= Please click on and rate if you like this post

  3. #3
    Lively Member
    Join Date
    Jan 2010
    Posts
    124

    Re: 'Animated' Menu

    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

  4. #4
    Lively Member
    Join Date
    Jan 2010
    Posts
    124

    Re: 'Animated' Menu

    Here is a new and cleaner version...:

    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
    
    
        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

  5. #5
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: 'Animated' Menu

    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.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2009
    Location
    Croatia
    Posts
    201

    Re: 'Animated' Menu

    Okay, thanks for the advice (i wouldn't thoutght of it myself)
    I'll try to improve this, when i get some spare time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width