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. How to select a single word in a list control ?

How to select a single word in a list control ?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 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.
  • S Offline
    S Offline
    Shay Harel
    wrote on last edited by
    #1

    Hi, I have a simple dialog that has a list control which displays a history of commands entered into the system. Let's say I want to select the last argument from a command and copy and paste it somewhere, I just can't do that in a list control since it let me select the whole line only. I tried using rich edit, but it has no notion of AddString which just adds text as we go. Is there any control out there to solve this problem before I sub class Rich Edit ????? Thanks.

    B N 2 Replies Last reply
    0
    • S Shay Harel

      Hi, I have a simple dialog that has a list control which displays a history of commands entered into the system. Let's say I want to select the last argument from a command and copy and paste it somewhere, I just can't do that in a list control since it let me select the whole line only. I tried using rich edit, but it has no notion of AddString which just adds text as we go. Is there any control out there to solve this problem before I sub class Rich Edit ????? Thanks.

      B Offline
      B Offline
      Bram van Kampen
      wrote on last edited by
      #2

      I have No idea of what you wanty to achieve, other than to try and pick an individual piece of test out of a line in a control of some kind.You must be using something like a List or Tree Control, and you are probably trying to achieve an effect you have seen in some microsoft products. Do not forget, Microsoft has the luxurary of being able to throw say 500 writers at a problem, and sort it by the weekend, and also provide these writers with details of proven but not yet released features. Subclassing will probably work, but is a lot of work on your end, and may not mesh in with future microsoft code releases. Why not try to be safe, and do as follows:-: When you pick the line, bring up a Dialog Box with the entry in it in a readonly Edit box, Allow the user to pick a section of text, and work from there. You still will have to go thru the pallaver of validating the entry, etc, but at least you have your (several)problems isolated. regards

      LateNightsInNewry

      1 Reply Last reply
      0
      • S Shay Harel

        Hi, I have a simple dialog that has a list control which displays a history of commands entered into the system. Let's say I want to select the last argument from a command and copy and paste it somewhere, I just can't do that in a list control since it let me select the whole line only. I tried using rich edit, but it has no notion of AddString which just adds text as we go. Is there any control out there to solve this problem before I sub class Rich Edit ????? Thanks.

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        Shay Harel wrote:

        Let's say I want to select the last argument from a command and copy and paste it somewhere, I just can't do that in a list control since it let me select the whole line only.

        Of course that is what it's made for. What about a simple multiline edit control with. Which is more handy than a list control. There are applications that do that. Make this edit box a readonly one. After every command you can add new line. :) This will help the user in selecting any line or any word or any character.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        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