Combobox Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shailja
    New Member
    • Feb 2007
    • 123

    Combobox Problem

    hi,

    I have one combobox. There are 5 items in it.
    Gujarat
    Maharashtra
    Mumbai
    Delhi
    Deharadun

    When i click on combobox and when i press M key from keyboard control should go to items starting from M. How to do code for this?
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by Shailja
    hi,

    I have one combobox. There are 5 items in it.
    Gujarat
    Maharashtra
    Mumbai
    Delhi
    Deharadun

    When i click on combobox and when i press M key from keyboard control should go to items starting from M. How to do code for this?
    set its sorted property to tru..
    type M and press dwn arrow key
    ur at the first point

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by Shailja
      ...When i click on combobox and when i press M key from keyboard control should go to items starting from M. How to do code for this?
      This will work if you set the .Style property to 2 - Dropdown List.

      Comment

      • Shailja
        New Member
        • Feb 2007
        • 123

        #4
        Originally posted by Killer42
        This will work if you set the .Style property to 2 - Dropdown List.

        After setting to it, how to write the code. I want to do like same as done in VB. When popup window is displayed in VB, and when i press first letter, all the items in that list get selected and control directly goes to the first item in the list.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by Shailja
          After setting to it, how to write the code. I want to do like same as done in VB. When popup window is displayed in VB, and when i press first letter, all the items in that list get selected and control directly goes to the first item in the list.
          You haven't said what version of VB you're using.

          In VB6, there's nothing to code - the combobox just works that way.

          Comment

          • Shailja
            New Member
            • Feb 2007
            • 123

            #6
            Originally posted by Killer42
            You haven't said what version of VB you're using.

            In VB6, there's nothing to code - the combobox just works that way.

            I am using VB6.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by Shailja
              I am using VB6.
              So, have you tried my suggestion?

              Comment

              • Shailja
                New Member
                • Feb 2007
                • 123

                #8
                Originally posted by Killer42
                So, have you tried my suggestion?

                it does not work.

                Comment

                • samycbe
                  New Member
                  • Feb 2007
                  • 83

                  #9
                  in vb6,

                  select the combobox style 2 - Dropdown combo.

                  it should work.......



                  samy

                  Comment

                  • Killer42
                    Recognized Expert Expert
                    • Oct 2006
                    • 8429

                    #10
                    Originally posted by samycbe
                    in vb6,

                    select the combobox style 2 - Dropdown combo.

                    it should work.......
                    That's what I said.

                    Comment

                    • Shailja
                      New Member
                      • Feb 2007
                      • 123

                      #11
                      Originally posted by Killer42
                      That's what I said.

                      It does not work. Contorl does not go directly to that item. I have to press down arrow key. That i dont want.
                      If combo contains following items:

                      Gujarat
                      Maharashtra
                      Mumbai
                      Raipur
                      Rajasthan

                      When i press m and down arrow key, maharashtra gets selected. I dont want that. What I want is when i press m maharashtra should get highlighted.

                      Comment

                      • Killer42
                        Recognized Expert Expert
                        • Oct 2006
                        • 8429

                        #12
                        Actually, I suggested style 2 - Dropdown List, not Dropdown Combo as Samycbe said. Which one are you using? I have just tested again, and 2 definitely works as you describe. The potential drawback, of course, is that you cannot type anything other than what's in the list. Is that a problem?

                        Comment

                        • Shailja
                          New Member
                          • Feb 2007
                          • 123

                          #13
                          Originally posted by Killer42
                          Actually, I suggested style 2 - Dropdown List, not Dropdown Combo as Samycbe said. Which one are you using? I have just tested again, and 2 definitely works as you describe. The potential drawback, of course, is that you cannot type anything other than what's in the list. Is that a problem?
                          I have changed it to 2 Drop Down List. It does not work.

                          Comment

                          • Killer42
                            Recognized Expert Expert
                            • Oct 2006
                            • 8429

                            #14
                            Originally posted by Shailja
                            I have changed it to 2 Drop Down List. It does not work.
                            That's really weird. What happens when you first press "m"? On my system, if I add that list of cities to a combobox with style 2, then press "m" it jumps to the first city starting with "m". As I knew it would. I don't know why your would be acting differently.

                            Try this exercise. Create a new project with just Form1, and add a combo box to the form, and set its Style property to 2. Then paste this into the code window for the form, replacing anything already there. Give it a run, and tell us what happens when you press "m".
                            Code:
                            Option Explicit
                            DefLng A-Z
                            
                            Private Sub Form_Load()
                              With Combo1
                                .AddItem "Gujarat"
                                .AddItem "Maharashtra"
                                .AddItem "Mumbai"
                                .AddItem "Raipur"
                                .AddItem "Rajasthan"
                              End With
                            End Sub

                            Comment

                            • OmOmOm
                              New Member
                              • Mar 2007
                              • 3

                              #15
                              Hi
                              I m creating a Visual C# application.
                              I have XML file .
                              <?xml version="1.0" encoding="utf-8" ?>
                              - <FilterType>
                              <Type>Schedulin g Requests</Type>
                              - <Fields>
                              - <Field>
                              <Name>Upper Tier Hearing</Name>
                              <DataType>Strin g</DataType>
                              <DBField>UTHear ing</DBField>
                              </Field>
                              - <Field>
                              <Name>Complexit y</Name>
                              <DataType>Strin g</DataType>
                              <DBField>Comp </DBField>
                              </Field>
                              </Fields>
                              <Type>Member Availability</Type>
                              - <Fields>
                              - <Field>
                              <Name>XTXTX</Name>
                              <DataType>Strin g</DataType>
                              <DBField>XTXT X</DBField>
                              </Field>
                              - <Field>
                              <Name>TComplexi ty</Name>
                              <DataType>Strin g</DataType>
                              <DBField>TCom p</DBField>
                              </Field>
                              </Fields>
                              </FilterType>

                              i want to add Name field as an item in combobox .so that i can use this combobox as a filter for my database query.
                              Can u Pls help me out??
                              Thanks
                              Himani

                              Comment

                              Working...