Re: Line and Col Positioning

new topic     » goto parent     » topic index » view thread      » older message » newer message

spent memory wrote:
> 
> can anyone tell me why these 2 lines get the line and column index
> correctlly sometmes with the richedit control i am using, and why it
> doesn't get them correctlly, fo example if i start of at line 1, col 1
> and start tapping the down arrow it increment correctly line 2, line 3
> etc but when i turn around and start hitting the up arrow it takes
> about 2 hits and then starts incrementing down, i cannot work out
> whether this is due to the way the richedit handles {13,10} -
> "\n","\r" , if so does anyone know the flags i should be initialising
> it with :- code below
> 
> 
> Line = sendMessage(code,EM_LINEFROMCHAR,-1,0)
> Col = w32lo_word(sendMessage(code,EM_GETSEL,0,0)) -
> sendMessage(code,EM_LINEINDEX,-1,0)
> 

Are you issuing these messages on KeyDown or KeyUp? I would recommend
KeyUp as that happens after the RichEdit has moved the caret.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu