Results 1 to 3 of 3

Thread: [VB 2005] Slide In/Out Side Menu

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    [VB 2005] Slide In/Out Side Menu

    I've created a slide in slide out menu for an application. This one comes from left of screen. If you want the menu on the right then changes the '.width 'for '.left' and change the '+' and '-' signs.

    You need:
    Panel - name: pnlmenu - dock: left - width: 20
    Timer - name: timhover - interval: 1
    Timer - name: timhover2 - interval: 1

    Code:
    Private Sub timhover_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timhover.Tick
            If pnlmenu.Width < 150 Then
                pnlmenu.Width = pnlmenu.Width + 8
            ElseIf pnlmenu.Width = 150 Then
                timhover.Enabled = False
            End If
        End Sub
    
        Private Sub pnlmenu_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles pnlmenu.MouseHover
            timhover.Enabled = True
        End Sub
    
        Private Sub pnlmenu_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles pnlmenu.MouseLeave
            timhover.Enabled = False
            timhover2.enabled = True
        End Sub
    
        Private Sub timhover2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timhover2.Tick
            If pnlmenu.Width > 20 Then
                pnlmenu.Width = pnlmenu.Width - 8
            ElseIf pnlmenu.Width = 20 Then
                timhover2.Enabled = False
            End If
        End Sub
    Hope It Helps

    -----
    knxrb

  2. #2
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    Re: [VB 2005] Slide In/Out Side Menu

    Hello, thank you for this awesome slider! It's nasty!
    But I have a question, if you hover the mouse over a button for example within the panel, the timer loses focus and the panel slides back into the ordinary width, what's the solution for this?

  3. #3

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: [VB 2005] Slide In/Out Side Menu

    Hi mac, this is pretty old now :P
    I'll write a smoother and better one and post that here soon

    knxrb
    Did I help you with your problem? If I did rate me by clicking here: Rate knxrb

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