|
-
Sep 7th, 2007, 11:47 AM
#1
Thread Starter
Hyperactive Member
[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
-
Aug 5th, 2010, 10:28 PM
#2
Lively Member
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?
-
Aug 5th, 2010, 10:40 PM
#3
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|