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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. combobox height?

combobox height?

Scheduled Pinned Locked Moved C#
tutorialquestion
14 Posts 4 Posters 1 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.
  • P Offline
    P Offline
    Pawan Kiran
    wrote on last edited by
    #1

    hi i have 10 items in combobox1. how to show all the combobox1 items in form_load without click on the downarrow of combobox1. Thanks in advance.

    L L C 3 Replies Last reply
    0
    • P Pawan Kiran

      hi i have 10 items in combobox1. how to show all the combobox1 items in form_load without click on the downarrow of combobox1. Thanks in advance.

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

      Sounds like you want a ListBox then?

      I are Troll :suss:

      P 1 Reply Last reply
      0
      • P Pawan Kiran

        hi i have 10 items in combobox1. how to show all the combobox1 items in form_load without click on the downarrow of combobox1. Thanks in advance.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        I use ComboBox.MaxDropDownItems to choose the maximum number of visible items (max 100!); you can set ComboBox.DroppedDown to make it show the items. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


        1 Reply Last reply
        0
        • L Lost User

          Sounds like you want a ListBox then?

          I are Troll :suss:

          P Offline
          P Offline
          Pawan Kiran
          wrote on last edited by
          #4

          Hi Sorry it is not a listbox, Every thing is like combobox only. but only the difference is, It is Combobox only, but in formload the height of combo should be in expandedmode(all combo items will be visible to the user)

          1 Reply Last reply
          0
          • P Pawan Kiran

            hi i have 10 items in combobox1. how to show all the combobox1 items in form_load without click on the downarrow of combobox1. Thanks in advance.

            C Offline
            C Offline
            Covean
            wrote on last edited by
            #5

            If I understood you right you mean this: comboBox1.DroppedDown = true;

            Greetings Covean

            P 1 Reply Last reply
            0
            • C Covean

              If I understood you right you mean this: comboBox1.DroppedDown = true;

              Greetings Covean

              P Offline
              P Offline
              Pawan Kiran
              wrote on last edited by
              #6

              Hi Thanks alot.it solves my combobox problem, but the problem is with Cursor, it shows WaitCursor instead of showing Default Cursor. Regards, Pawan. -- Modified Friday, March 5, 2010 1:26 AM

              C 1 Reply Last reply
              0
              • P Pawan Kiran

                Hi Thanks alot.it solves my combobox problem, but the problem is with Cursor, it shows WaitCursor instead of showing Default Cursor. Regards, Pawan. -- Modified Friday, March 5, 2010 1:26 AM

                C Offline
                C Offline
                Covean
                wrote on last edited by
                #7

                I can't reproduce your problem, but you can try this.

                Cursor = Cursors.Default;

                Greetings Covean

                P 1 Reply Last reply
                0
                • C Covean

                  I can't reproduce your problem, but you can try this.

                  Cursor = Cursors.Default;

                  Greetings Covean

                  P Offline
                  P Offline
                  Pawan Kiran
                  wrote on last edited by
                  #8

                  Hi Working fine, but the problem is with clicks only. To raise the EventHandlers i need to click the button for twice. Let me know if u have any idea, Thanks in advance. -- Modified Friday, March 5, 2010 3:57 AM

                  C 1 Reply Last reply
                  0
                  • P Pawan Kiran

                    Hi Working fine, but the problem is with clicks only. To raise the EventHandlers i need to click the button for twice. Let me know if u have any idea, Thanks in advance. -- Modified Friday, March 5, 2010 3:57 AM

                    C Offline
                    C Offline
                    Covean
                    wrote on last edited by
                    #9

                    Sorry I do not really understand what you mean. Which button do you have to click twice? If you just need that an event should be risen, then just call the event in your formload yourself.

                    Greetings Covean

                    P 1 Reply Last reply
                    0
                    • C Covean

                      Sorry I do not really understand what you mean. Which button do you have to click twice? If you just need that an event should be risen, then just call the event in your formload yourself.

                      Greetings Covean

                      P Offline
                      P Offline
                      Pawan Kiran
                      wrote on last edited by
                      #10

                      I have set the ComboBox DroppedDown Property to true. Now the actual problem is When the ComboBox DroppedDown is Shown Or True I have to actually click twice to get out of the form or need to click twice to do anything. For Example in My Form If I have 2 Controls One is ComboBox and Another Button Which Clicked Just Closes the Form. Then I set ComboBox DroppedDown = true.So When the ComboBox DroppedDown = true to click on Close Button I need to click twice to initate click event on the button. Plz Help me on how to do it once when ComboBox DroppedDown = true.If Combobox DroppedDown = true. I need to click twice to click on the Form as Well.

                      C 1 Reply Last reply
                      0
                      • P Pawan Kiran

                        I have set the ComboBox DroppedDown Property to true. Now the actual problem is When the ComboBox DroppedDown is Shown Or True I have to actually click twice to get out of the form or need to click twice to do anything. For Example in My Form If I have 2 Controls One is ComboBox and Another Button Which Clicked Just Closes the Form. Then I set ComboBox DroppedDown = true.So When the ComboBox DroppedDown = true to click on Close Button I need to click twice to initate click event on the button. Plz Help me on how to do it once when ComboBox DroppedDown = true.If Combobox DroppedDown = true. I need to click twice to click on the Form as Well.

                        C Offline
                        C Offline
                        Covean
                        wrote on last edited by
                        #11

                        This is usually not possible, because if the combobox is dropped down it has the mouse capture. If you set the mouse capture to an other control it directly loses dropped down state. You maybe can try to redirect all mouse inputs from your combobox to the parent, but I don't think that this is possible and even if its possible its hard to implement.

                        Greetings Covean

                        P 1 Reply Last reply
                        0
                        • C Covean

                          This is usually not possible, because if the combobox is dropped down it has the mouse capture. If you set the mouse capture to an other control it directly loses dropped down state. You maybe can try to redirect all mouse inputs from your combobox to the parent, but I don't think that this is possible and even if its possible its hard to implement.

                          Greetings Covean

                          P Offline
                          P Offline
                          Pawan Kiran
                          wrote on last edited by
                          #12

                          Hi One more Question Regarding same combobox.Droppeddown I have a Treeview1 inside my Combobox1 when i set Combobox.Droppeddown=true it is not working. Any Idea Plz let me know..

                          C 1 Reply Last reply
                          0
                          • P Pawan Kiran

                            Hi One more Question Regarding same combobox.Droppeddown I have a Treeview1 inside my Combobox1 when i set Combobox.Droppeddown=true it is not working. Any Idea Plz let me know..

                            C Offline
                            C Offline
                            Covean
                            wrote on last edited by
                            #13

                            No sorry I never used a treeview in a combobox.

                            Greetings Covean

                            P 1 Reply Last reply
                            0
                            • C Covean

                              No sorry I never used a treeview in a combobox.

                              Greetings Covean

                              P Offline
                              P Offline
                              Pawan Kiran
                              wrote on last edited by
                              #14

                              Thanks alot for your contribution.. Cheers, Pawan.

                              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