CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2012
    Posts
    21

    23h,10 stackoverflow

    I'm Working on RichEdit Control, so when i paste the below code, cursor has to go directly to that location and write some text in rich edit control. So please suggest, i will proud if send some sample code.

    23H,10 STACKOVERFLOW : Cursor has to go 23rd row and 10th column and need to write the text like shown.... In RichEdit Control.

    Thanks in advance to all coders..



    Regards

    Sam

    (Note: I have tried with GetSel,SetSel,GetCaretPos, SetCaretPos not solved my problem)

  2. #2
    Join Date
    Aug 2012
    Posts
    21

    Move Cursor position in RichEdit Control

    Hi All!!

    I'm Working on RichEdit Control, so when i paste the below code, cursor has to go directly to that location and write some text in rich edit control. So please suggest, and provide some sample code.

    23H,10 CodeGuru : Cursor has to go 23rd row and 10th column and need to write the text like shown.... In RichEdit Control.

    Thanks in advance to all coders..

    Regards
    Sam

    (Note: I have tried with GetSel,SetSel,GetCaretPos, SetCaretPos not solved my problem, cursor moved by pixel wsie)

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: 23h,10 stackoverflow

    Quote Originally Posted by mr.sam1024 View Post
    I'm Working on RichEdit Control, so when i paste the below code...
    And where is this code?
    Victor Nijegorodov

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Move Cursor position in RichEdit Control

    Hmm... The same question under another title?
    And still no any code despite the promise:
    Quote Originally Posted by mr.sam1024
    i paste the below code
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2012
    Posts
    21

    Re: 23h,10 stackoverflow

    I Specified the code, that is here.. 23H,10. It means that 23rd row and 10column. So when i paste this code on richedit control.. cursor has to go directly to the 23rd row and 10 column location. And write some text at that position.

    Please do the needful VictorN.

    Thanks
    Sam

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: 23h,10 stackoverflow

    Quote Originally Posted by mr.sam1024 View Post
    I Specified the code, that is here.. 23H,10. It means that 23rd row and 10column.
    And where is that place that you called "here"?
    Victor Nijegorodov

  7. #7
    Join Date
    Aug 2012
    Posts
    21

    Re: 23h,10 stackoverflow

    write 23H,10 in notepad and copy it. and then paste on richedit control. then cursor has to go 23rd row and 10 column.

    I hope this information is clear to you.

  8. #8
    Join Date
    Apr 1999
    Posts
    27,449

    Re: 23h,10 stackoverflow

    Quote Originally Posted by mr.sam1024 View Post
    write 23H,10 in notepad and copy it. and then paste on richedit control. then cursor has to go 23rd row and 10 column.

    I hope this information is clear to you.
    So let me try to restate what you're asking, since you seem to have trouble asking the question:

    "I would like to know if there is a way to paste text into a CRichEditCtrl at a certain row and column position."

    Is that the question?

    Regards,

    Paul McKenzie

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: 23h,10 stackoverflow

    Quote Originally Posted by mr.sam1024 View Post
    I hope this information is clear to you.
    Nope.

  10. #10
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: 23h,10 stackoverflow

    EM_LINEINDEX - go to the desired line
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    Code:
    SendMessage(hWnd, EM_LINEINDEX, (WPARAM)23, 0);
    EM_SETSEL - make a selection, where the text is to be inserted
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    Code:
    SendMessage(hWnd, EM_SETSEL, 10, 10);
    EM_REPLACESEL - replace the selection with a new text
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    Code:
    SendMessage(hWnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)"STACKOVERFLOW");
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  11. #11
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: 23h,10 stackoverflow

    [ threads merged ]
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Tags for this Thread

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