1. Textbox

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C1A771.E5986F40
	charset="iso-8859-1"

Hi i am currently working on a network text program and Im using a textbox to
recive the text but I Cant seem to get the cursor to move to the next line when a
new message is recived, Can nayone give me code, examples to help

Philip/Orpheus

------=_NextPart_000_000F_01C1A771.E5986F40
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#fffff0>
<DIV><FONT face=Arial size=2>Hi i am currently working on a network text program
and Im using a textbox to recive the text but I Cant seem to get the cursor to 
move to the next line when a new message is recived, Can nayone give me code, 
examples to help</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>

------=_NextPart_000_000F_01C1A771.E5986F40--

new topic     » topic index » view message » categorize

2. Re: Textbox

>----- Original Message -----
>From: PETER at pmullen.fsnet.co.uk
>To: EUforum
>Sent: Monday, January 28, 2002 7:33 AM
>Subject: Textbox
>
>
>
>Hi i am currently working on a network text program and
>Im using a textbox to recive the text but I Cant seem
>to get the cursor to move to the next line when a new
>message is recived, Can nayone give me code, examples
>to help

Hi,
firstly, I'm assuming you are using win32lib.

There is a routine in win32lib called setSelectedText() that can help you.
It is designed to replace any selected text with the new text that you
provide. The trick is to move the cursor to the end of the current text and
"select" the end-of-text before using this routine. Here is some sample code
for that...

    integer lLength

    -- Get the length of any existing text
    lLength = sendMessage( msgarea, WM_GETTEXTLENGTH, 0, 0 )
    -- Move the cursor to the end of the text.
    setIndex(msgarea, lLength+1)
    -- Append the new text, including a CR and LF
    setSelectedText(msgarea, newtext & 13 & 10)

This works if the msgarea is created as a MleText control rather than an
EditText control.

However, in testing this code, I found a bug in the win32lib file. To fix
this, you need to find the setSelectedText procedure and the line ...

    if lo_word(result)<hi_word(result) then

then change the "<" to "<=" which should result in the fixed line ...

    if lo_word(result)<=hi_word(result) then

Another cosideration is that there is a limit to how much text a MleText
control can hold. It might be better to use a RichEdit control if you need
more than 65,000 characters in the message area.

---------
Derek.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu