• Welcome to Valhalla Legends Archive.
 

[VB6] Add to RTB

Started by PaiD, August 20, 2005, 09:58 AM

Previous topic - Next topic

PaiD

How would I go about appending text to a rich text box without the rich text box scrolling down to the new data but still being added to the bottom. I think it uses API but I am not sure. Any ideas?

PS. I have googled and looked @ pscode.com, no luck

Mangix

lol do a search on Grok's AddChat function. it's really nice :(

here's how you append it.

rtb.SelStart = Len(.Text)


l2k-Shadow

In the function, remove the .SelStart lines.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

PaiD

Um I tried that. The problem Then is if the user has something hightlighted while the AddChat Function has been exucated it will append to the rich text box at the end of the hightlighted part.

Yegg

Are you sure you are using the AddChat subroutine properly?

PaiD


Soul Taker

Guys... could you actually READ his original post?  I believe many people around here have tried to make a RTB or RT add text to the bottom but not scroll, mostly unsucessfully.  I think Skywing had to make his own custom version of an RT or something... but don't quote me on that.

R.a.B.B.i.T

Add the text but don't set the pointer to the end of the text in the RTB then.  It's not hard, reather, it's extremely simple.

Yegg

Oh, I didn't read his question properly. I know that Python's wxPython library has a function, SetInsertionPoint(), it takes one parameter, if the value it receives is 0 then it keeps a text control (or RichTextBox) at the very beginning of all the text. And it will not scroll down. I know Visual Basic 6 has something like this, however I do not know what function or method it may be.

R.a.B.B.i.T

It's not using .SelStart(Len(.Text)) after adding <blarg>

Soul Taker

I have a feeling he only wants this functionality when the user is holding the scroll carat though.

UserLoser.

IIRC, you need to use WM_SETREDRAW, EM_GETSCROLLPOS, EM_SETSCROLLPOS, and InvalidateRect

PaiD


Soul Taker

Quote from: UserLoser on August 21, 2005, 12:47 AM
IIRC, you need to use WM_SETREDRAW, EM_GETSCROLLPOS, EM_SETSCROLLPOS, and InvalidateRect
That's the cheater way to do it though!

Mangix

the only thing that matters is the fact that it works.