Basic ComboBox question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Sworder

    Basic ComboBox question

    Hi,

    I have a ComboBox that contains 1,400 sorted items [don't ask,
    management decision :(]. Here's the list:

    abba
    apple
    [...lots of items]...
    cabba
    caccaa
    capple
    czar
    [...lots of items]...
    pheasentHeadOfD eath

    Let's say the user is trying to select "capple". The natural thing to do
    is to dropdown the listbox and type the first few letters of the item's
    name. So the user might type "cap." The behavior is as follows: When the
    user hits 'c', 'caba' is selected then the user immediately hits 'a' at
    which point 'abba' is selected and then the user hits 'p' and
    'pheasentHeadOf Death' is selected. Is there a way to get the ComboBox to
    realize that the user is trying to spell a word and highlight the first item
    that begins with 'cap'? If this user waits more than x seconds between
    keystrokes, the comboBox would realize that he's searching for a new item. I
    can think of ways to program this manually, but I wanted to make sure that
    this type of thing wasn't already built into the ComboBox via some sort of
    "ComboBoxUnders tandsKeystrokes AsWords" property or something.

    David


  • Karen Martinez

    #2
    Re: Basic ComboBox question

    The ComboBox does not have this functionality built in, so you'll have to do
    something yourself. See the Genghis CompletionCombo from Sells Brothers for
    an example if you want to write your own, or you can use the Genghis's dll
    for free if you want:



    "David Sworder" <dsworder@cts.c om> wrote in message
    news:uG3ubmdiDH A.3328@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi,
    >
    > I have a ComboBox that contains 1,400 sorted items [don't ask,
    > management decision :(]. Here's the list:
    >
    > abba
    > apple
    > [...lots of items]...
    > cabba
    > caccaa
    > capple
    > czar
    > [...lots of items]...
    > pheasentHeadOfD eath
    >
    > Let's say the user is trying to select "capple". The natural thing to[/color]
    do[color=blue]
    > is to dropdown the listbox and type the first few letters of the item's
    > name. So the user might type "cap." The behavior is as follows: When the
    > user hits 'c', 'caba' is selected then the user immediately hits 'a' at
    > which point 'abba' is selected and then the user hits 'p' and
    > 'pheasentHeadOf Death' is selected. Is there a way to get the ComboBox to
    > realize that the user is trying to spell a word and highlight the first[/color]
    item[color=blue]
    > that begins with 'cap'? If this user waits more than x seconds between
    > keystrokes, the comboBox would realize that he's searching for a new item.[/color]
    I[color=blue]
    > can think of ways to program this manually, but I wanted to make sure that
    > this type of thing wasn't already built into the ComboBox via some sort of
    > "ComboBoxUnders tandsKeystrokes AsWords" property or something.
    >
    > David
    >
    >[/color]


    Comment

    • Karen Martinez

      #3
      Re: Basic ComboBox question

      The ComboBox does not have this functionality built in, so you'll have to do
      something yourself. See the Genghis CompletionCombo from Sells Brothers for
      an example if you want to write your own, or you can use the Genghis's dll
      for free if you want:



      "David Sworder" <dsworder@cts.c om> wrote in message
      news:uG3ubmdiDH A.3328@tk2msftn gp13.phx.gbl...[color=blue]
      > Hi,
      >
      > I have a ComboBox that contains 1,400 sorted items [don't ask,
      > management decision :(]. Here's the list:
      >
      > abba
      > apple
      > [...lots of items]...
      > cabba
      > caccaa
      > capple
      > czar
      > [...lots of items]...
      > pheasentHeadOfD eath
      >
      > Let's say the user is trying to select "capple". The natural thing to[/color]
      do[color=blue]
      > is to dropdown the listbox and type the first few letters of the item's
      > name. So the user might type "cap." The behavior is as follows: When the
      > user hits 'c', 'caba' is selected then the user immediately hits 'a' at
      > which point 'abba' is selected and then the user hits 'p' and
      > 'pheasentHeadOf Death' is selected. Is there a way to get the ComboBox to
      > realize that the user is trying to spell a word and highlight the first[/color]
      item[color=blue]
      > that begins with 'cap'? If this user waits more than x seconds between
      > keystrokes, the comboBox would realize that he's searching for a new item.[/color]
      I[color=blue]
      > can think of ways to program this manually, but I wanted to make sure that
      > this type of thing wasn't already built into the ComboBox via some sort of
      > "ComboBoxUnders tandsKeystrokes AsWords" property or something.
      >
      > David
      >
      >[/color]


      Comment

      • Jeffrey Tan[MSFT]

        #4
        RE: Basic ComboBox question


        Hi David,

        Thank you for posting in this group.

        The ComboBox control does not contain such function.
        I think you should create a custom control inherited from the ComboBox,
        then you can apply your program logic in your class.

        For example, you can handle the ComboBox_TextCh anged event, select relevant
        element while the customer typing.(But you should set the appropriate
        charaters focus of the text).

        If you still have any questions, please feel free to let me know.
        Hope this helps,
        Jeffrey Tan
        Microsoft Online Partner Support
        Get Secure! - www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.

        --------------------
        | From: "David Sworder" <dsworder@cts.c om>
        | Subject: Basic ComboBox question
        | Date: Fri, 3 Oct 2003 11:10:12 -0700
        | Lines: 31
        | X-Priority: 3
        | X-MSMail-Priority: Normal
        | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        | Message-ID: <uG3ubmdiDHA.33 28@tk2msftngp13 .phx.gbl>
        | Newsgroups:
        microsoft.publi c.dotnet.framew ork.windowsform s,microsoft.pub lic.dotnet.lang u
        ages.csharp
        | NNTP-Posting-Host: rrcs-west-66-27-51-213.biz.rr.com 66.27.51.213
        | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
        | Xref: cpmsftngxa06.ph x.gbl
        microsoft.publi c.dotnet.langua ges.csharp:1888 22
        microsoft.publi c.dotnet.framew ork.windowsform s:53702
        | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        |
        | Hi,
        |
        | I have a ComboBox that contains 1,400 sorted items [don't ask,
        | management decision :(]. Here's the list:
        |
        | abba
        | apple
        | [...lots of items]...
        | cabba
        | caccaa
        | capple
        | czar
        | [...lots of items]...
        | pheasentHeadOfD eath
        |
        | Let's say the user is trying to select "capple". The natural thing to
        do
        | is to dropdown the listbox and type the first few letters of the item's
        | name. So the user might type "cap." The behavior is as follows: When the
        | user hits 'c', 'caba' is selected then the user immediately hits 'a' at
        | which point 'abba' is selected and then the user hits 'p' and
        | 'pheasentHeadOf Death' is selected. Is there a way to get the ComboBox to
        | realize that the user is trying to spell a word and highlight the first
        item
        | that begins with 'cap'? If this user waits more than x seconds between
        | keystrokes, the comboBox would realize that he's searching for a new
        item. I
        | can think of ways to program this manually, but I wanted to make sure that
        | this type of thing wasn't already built into the ComboBox via some sort of
        | "ComboBoxUnders tandsKeystrokes AsWords" property or something.
        |
        | David
        |
        |
        |

        Comment

        • Jeffrey Tan[MSFT]

          #5
          RE: Basic ComboBox question


          Hi David,

          Thank you for posting in this group.

          The ComboBox control does not contain such function.
          I think you should create a custom control inherited from the ComboBox,
          then you can apply your program logic in your class.

          For example, you can handle the ComboBox_TextCh anged event, select relevant
          element while the customer typing.(But you should set the appropriate
          charaters focus of the text).

          If you still have any questions, please feel free to let me know.
          Hope this helps,
          Jeffrey Tan
          Microsoft Online Partner Support
          Get Secure! - www.microsoft.com/security
          This posting is provided "as is" with no warranties and confers no rights.

          --------------------
          | From: "David Sworder" <dsworder@cts.c om>
          | Subject: Basic ComboBox question
          | Date: Fri, 3 Oct 2003 11:10:12 -0700
          | Lines: 31
          | X-Priority: 3
          | X-MSMail-Priority: Normal
          | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
          | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
          | Message-ID: <uG3ubmdiDHA.33 28@tk2msftngp13 .phx.gbl>
          | Newsgroups:
          microsoft.publi c.dotnet.framew ork.windowsform s,microsoft.pub lic.dotnet.lang u
          ages.csharp
          | NNTP-Posting-Host: rrcs-west-66-27-51-213.biz.rr.com 66.27.51.213
          | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
          | Xref: cpmsftngxa06.ph x.gbl
          microsoft.publi c.dotnet.langua ges.csharp:1888 22
          microsoft.publi c.dotnet.framew ork.windowsform s:53702
          | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
          |
          | Hi,
          |
          | I have a ComboBox that contains 1,400 sorted items [don't ask,
          | management decision :(]. Here's the list:
          |
          | abba
          | apple
          | [...lots of items]...
          | cabba
          | caccaa
          | capple
          | czar
          | [...lots of items]...
          | pheasentHeadOfD eath
          |
          | Let's say the user is trying to select "capple". The natural thing to
          do
          | is to dropdown the listbox and type the first few letters of the item's
          | name. So the user might type "cap." The behavior is as follows: When the
          | user hits 'c', 'caba' is selected then the user immediately hits 'a' at
          | which point 'abba' is selected and then the user hits 'p' and
          | 'pheasentHeadOf Death' is selected. Is there a way to get the ComboBox to
          | realize that the user is trying to spell a word and highlight the first
          item
          | that begins with 'cap'? If this user waits more than x seconds between
          | keystrokes, the comboBox would realize that he's searching for a new
          item. I
          | can think of ways to program this manually, but I wanted to make sure that
          | this type of thing wasn't already built into the ComboBox via some sort of
          | "ComboBoxUnders tandsKeystrokes AsWords" property or something.
          |
          | David
          |
          |
          |

          Comment

          Working...