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. C / C++ / MFC
  4. CB_SELECTSTRING related question

CB_SELECTSTRING related question

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutoriallearning
5 Posts 2 Posters 0 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.
  • T Offline
    T Offline
    tagopi
    wrote on last edited by
    #1

    Hello everybody, i am having a combobox (created through resource), and through code, i am updating the combobox with a list. for example, i am filling with "Kir" and "K". if i use CB_SELECTSTRING to select "K", its always selecting "Kir". if i use "Kj" in place of "K", then the selection between "Kir" and "Kj" is fine. from msdn definition : It selects the first list item, if any, that begins with the characters in the specified text. is there any other method to solve this issue? iam trying like this. SendMessage(hList, CB_SELECTSTRING , -1,(LPARAM)(LPCSTR)tt.c_str()); Thanks in Advance, A. Gopinath.

    E 1 Reply Last reply
    0
    • T tagopi

      Hello everybody, i am having a combobox (created through resource), and through code, i am updating the combobox with a list. for example, i am filling with "Kir" and "K". if i use CB_SELECTSTRING to select "K", its always selecting "Kir". if i use "Kj" in place of "K", then the selection between "Kir" and "Kj" is fine. from msdn definition : It selects the first list item, if any, that begins with the characters in the specified text. is there any other method to solve this issue? iam trying like this. SendMessage(hList, CB_SELECTSTRING , -1,(LPARAM)(LPCSTR)tt.c_str()); Thanks in Advance, A. Gopinath.

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      Try to use the result of CB_FINDSTRINGEXACT for CB_SETCURSEL :)

      They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

      T 1 Reply Last reply
      0
      • E Eugen Podsypalnikov

        Try to use the result of CB_FINDSTRINGEXACT for CB_SETCURSEL :)

        They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

        T Offline
        T Offline
        tagopi
        wrote on last edited by
        #3

        Hello, sorry, i forgot to add that, i tried this also. CB_FINDSTRINGEXACT also returns the same issue. Thanks, A. Gopinath.

        E 1 Reply Last reply
        0
        • T tagopi

          Hello, sorry, i forgot to add that, i tried this also. CB_FINDSTRINGEXACT also returns the same issue. Thanks, A. Gopinath.

          E Offline
          E Offline
          Eugen Podsypalnikov
          wrote on last edited by
          #4

          It should return a zero-based index... :)

          They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

          T 1 Reply Last reply
          0
          • E Eugen Podsypalnikov

            It should return a zero-based index... :)

            They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

            T Offline
            T Offline
            tagopi
            wrote on last edited by
            #5

            Hello, Yes, you are right, now its working. thanks. Regards, A. Gopinath.

            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