954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sliding Menus

hello !
i am developing an desktop application , i want to make my menus just like in VS2008 have tool box , ,when we click on the main tab it will open and slid down , i want to make same thing , is there any one who guide me from where i can start this .
Sorry for my bad english :)

Regards

M.Waqas Aslam

waqasaslammmeo
Posting Pro in Training
472 posts since Aug 2011
Reputation Points: 38
Solved Threads: 82
 

no one answered :(

waqasaslammmeo
Posting Pro in Training
472 posts since Aug 2011
Reputation Points: 38
Solved Threads: 82
 

dude..
u can use threading to do that.

and if u really want to make application with rich animation..
like sliding menus, shadow and blur effects..
u can use WPF

bilal_fazlani
Junior Poster in Training
55 posts since Oct 2011
Reputation Points: 10
Solved Threads: 3
 

See if this helps.
New.Project, 3.Buttons, 3.Panels(view attached image)

Public Class Form1
    Private pnTemp As Panel, iSelPanel As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        pnTemp = Panel1 '// pnTemp, just easier to work w/. :)
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        pnTemp = Panel2
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        pnTemp = Panel3
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

#Region "-----===-----===-----===-----===-----===  ===-----===-----===-----===-----===-----"
    Private Sub collapsePanel(ByVal selPanel As Panel)
        With selPanel.Name
            iSelPanel = CInt(.Substring(.Length - 1)) '// get # at end of Panel.Name.
        End With
        For i As Integer = 0 To selPanel.Height '// loop from 0 to panel.height
            selPanel.Height -= 1 '// ...and reduce height.
            For Each ctl In New Control() {Button1, Panel1, Button2, Panel2, Button3, Panel3} '// loop thru all btns and panels.
                If CInt(ctl.Name.Substring(ctl.Name.Length - 1)) > iSelPanel Then '// check if # at end of btn/panel is greater than the selectedPanel.
                    ctl.Top -= 1 '// move btn/panel up.
                End If
            Next
        Next
    End Sub
    Private Sub expandPanel(ByVal selPanel As Panel, Optional ByVal iPanelHeight As Integer = 125)
        With selPanel.Name
            iSelPanel = CInt(.Substring(.Length - 1))
        End With
        For i As Integer = 0 To iPanelHeight
            selPanel.Height += 1
            For Each ctl In New Control() {Button1, Panel1, Button2, Panel2, Button3, Panel3}
                If CInt(ctl.Name.Substring(ctl.Name.Length - 1)) > iSelPanel Then
                    ctl.Top += 1
                End If
            Next
        Next
    End Sub
#End Region
End Class
Attachments sliding.menu_.jpg 21KB
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

See if this helps. New.Project, 3.Buttons, 3.Panels(view attached image)

Public Class Form1
    Private pnTemp As Panel, iSelPanel As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        pnTemp = Panel1 '// pnTemp, just easier to work w/. :)
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        pnTemp = Panel2
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        pnTemp = Panel3
        If pnTemp.Height = 0 Then expandPanel(pnTemp) Else collapsePanel(pnTemp)
    End Sub

#Region "-----===-----===-----===-----===-----===  ===-----===-----===-----===-----===-----"
    Private Sub collapsePanel(ByVal selPanel As Panel)
        With selPanel.Name
            iSelPanel = CInt(.Substring(.Length - 1)) '// get # at end of Panel.Name.
        End With
        For i As Integer = 0 To selPanel.Height '// loop from 0 to panel.height
            selPanel.Height -= 1 '// ...and reduce height.
            For Each ctl In New Control() {Button1, Panel1, Button2, Panel2, Button3, Panel3} '// loop thru all btns and panels.
                If CInt(ctl.Name.Substring(ctl.Name.Length - 1)) > iSelPanel Then '// check if # at end of btn/panel is greater than the selectedPanel.
                    ctl.Top -= 1 '// move btn/panel up.
                End If
            Next
        Next
    End Sub
    Private Sub expandPanel(ByVal selPanel As Panel, Optional ByVal iPanelHeight As Integer = 125)
        With selPanel.Name
            iSelPanel = CInt(.Substring(.Length - 1))
        End With
        For i As Integer = 0 To iPanelHeight
            selPanel.Height += 1
            For Each ctl In New Control() {Button1, Panel1, Button2, Panel2, Button3, Panel3}
                If CInt(ctl.Name.Substring(ctl.Name.Length - 1)) > iSelPanel Then
                    ctl.Top += 1
                End If
            Next
        Next
    End Sub
#End Region
End Class


this is what i needed , thankkkkkkkkkkkkk you soo much , great help for me :) thank again bro

Regards

waqasaslammmeo
Posting Pro in Training
472 posts since Aug 2011
Reputation Points: 38
Solved Threads: 82
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: