Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Accordion in windows Forms

Accordion in windows Forms

Scheduled Pinned Locked Moved Windows Forms
winformshelpquestion
9 Posts 3 Posters 16 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sudevsu
    wrote on last edited by
    #1

    Could someone help in understanding with examples of multiple controls in a Panel which is in an Table layout and should behave like web Accordion? I have gone through the websites and other tutorials but none of those examples have real time scenarios. So it is very hard to find the exact procedure of accordion will act in windows forms with multiple controls like textbox, combo box, checked list box, button etc. I would like to have one such article with real time Examples of Code snippets from SA because this concept has not been explained properly anywhere in google with snippets and examples

    Your help is much appreciated. Thanks Happy Coding!

    L Richard DeemingR 3 Replies Last reply
    0
    • S sudevsu

      Could someone help in understanding with examples of multiple controls in a Panel which is in an Table layout and should behave like web Accordion? I have gone through the websites and other tutorials but none of those examples have real time scenarios. So it is very hard to find the exact procedure of accordion will act in windows forms with multiple controls like textbox, combo box, checked list box, button etc. I would like to have one such article with real time Examples of Code snippets from SA because this concept has not been explained properly anywhere in google with snippets and examples

      Your help is much appreciated. Thanks Happy Coding!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please read http://www.codeproject.com/Messages/3137519/Forum-Guidelines-PLEASE-READ.aspx[^].

      S 1 Reply Last reply
      0
      • S sudevsu

        Could someone help in understanding with examples of multiple controls in a Panel which is in an Table layout and should behave like web Accordion? I have gone through the websites and other tutorials but none of those examples have real time scenarios. So it is very hard to find the exact procedure of accordion will act in windows forms with multiple controls like textbox, combo box, checked list box, button etc. I would like to have one such article with real time Examples of Code snippets from SA because this concept has not been explained properly anywhere in google with snippets and examples

        Your help is much appreciated. Thanks Happy Coding!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What do you mean by "real time"? :~

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

        S 1 Reply Last reply
        0
        • L Lost User

          Please read http://www.codeproject.com/Messages/3137519/Forum-Guidelines-PLEASE-READ.aspx[^].

          S Offline
          S Offline
          sudevsu
          wrote on last edited by
          #4

          Oops. I am sorry. I don't want to help me in writing an article. I actually wanted an article/ tutorial to understand accordion in windows forms. I am working on windows forms and I wanted to do something like in Web Accordions. That's the only intension.

          Your help is much appreciated. Thanks Happy Coding!

          1 Reply Last reply
          0
          • L Lost User

            What do you mean by "real time"? :~

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

            S Offline
            S Offline
            sudevsu
            wrote on last edited by
            #5

            Meaning I worked on one such form and I tried to create my own code for accordion. But my form has only label as control. If I add more controls, I do not know how to proceed for accordion. Real time meaning: which has most used the controls in the form like combo box, listbox, button etc

            Your help is much appreciated. Thanks Happy Coding!

            L 1 Reply Last reply
            0
            • S sudevsu

              Meaning I worked on one such form and I tried to create my own code for accordion. But my form has only label as control. If I add more controls, I do not know how to proceed for accordion. Real time meaning: which has most used the controls in the form like combo box, listbox, button etc

              Your help is much appreciated. Thanks Happy Coding!

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I'm sorry, but I'm having trouble understanding what you are trying to do, or where you are stuck. Perhaps some code would help; or a picture :)

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              S 1 Reply Last reply
              0
              • L Lost User

                I'm sorry, but I'm having trouble understanding what you are trying to do, or where you are stuck. Perhaps some code would help; or a picture :)

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                S Offline
                S Offline
                sudevsu
                wrote on last edited by
                #7

                OK let me put this again Clear. You must be knowing for Accordion in Web applications work. I want a similar one in windows. I already did try. But If my panel has any other controls other than Label, it doesn't work. Could not figure it out how to achieve this with all the controls in the panel. Here is the code that will act labels click as accordion

                Private Sub ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click, Label3.Click, Label5.Click
                'find out which label was clicked
                Dim lbl As Label = CType(sender, Label)
                'find the panel containing the label
                Dim pnl As Panel = lbl.Parent

                For Each p As Panel In TableLayoutPanel1.Controls
                  Dim l As Label = CType(p.Controls(0), Label)
                  If p.Equals(pnl) Then
                    'expand or collapse the panel
                    If p.Height = 150 Then
                      p.Height = 25
                      l.ForeColor = Color.Black
                    Else
                      p.Height = 150
                      l.ForeColor = Color.Black
                    End If
                
                  Else
                    p.Height = 25
                    l.ForeColor = Color.Black
                    l.Image = My.Resources.arrow
                  End If
                Next
                

                End Sub

                Your help is much appreciated. Thanks Happy Coding!

                1 Reply Last reply
                0
                • S sudevsu

                  Could someone help in understanding with examples of multiple controls in a Panel which is in an Table layout and should behave like web Accordion? I have gone through the websites and other tutorials but none of those examples have real time scenarios. So it is very hard to find the exact procedure of accordion will act in windows forms with multiple controls like textbox, combo box, checked list box, button etc. I would like to have one such article with real time Examples of Code snippets from SA because this concept has not been explained properly anywhere in google with snippets and examples

                  Your help is much appreciated. Thanks Happy Coding!

                  Richard DeemingR Offline
                  Richard DeemingR Offline
                  Richard Deeming
                  wrote on last edited by
                  #8

                  Something like this? Easy WinForms Accordion Control[^]


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                  S 1 Reply Last reply
                  0
                  • Richard DeemingR Richard Deeming

                    Something like this? Easy WinForms Accordion Control[^]


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    S Offline
                    S Offline
                    sudevsu
                    wrote on last edited by
                    #9

                    Yeah I have already been there. But if my panel has button/ Textbox or any other controls I do not understand how to proceed further.

                    Your help is much appreciated. Thanks Happy Coding!

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups