CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    reverse text-selection

    I want to select a portion of a string. I do not want to select it from left to right but from right to left...
    Example:

    I want selstart to be at 6
    and I want it to end at 3

    Basicly I want the cursor at the beginnning of the selection, not at the end.


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: reverse text-selection

    NOT Possible, as far as i KNOW.

    If you look into MSDN, in EM_SETSEL textbox message setion, this is what is said:
    "...If the nStart parameter is 0 and the nEnd parameter is -1, all the text in the edit control is selected. If nStart is -1, any current selection is removed. The caret is placed at the end of the selection indicated by the greater of the two values nEnd and nStart.

    Since this msg is the base for seletion, i think it is not possible in simple manner, unless you subclass it and paint the strings yourself etc..

    Anyway the purpose of selection is to say that the next character being typed will replace the complete set of them!.So caret position is "kind of" in correct place, if it is after the selection!, because the char shoud appear BEFORE the caret

    RK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured