Automatically scrolling to the bottom of a multiline textbox with scrollbar in CF 1.0

Hi,

Is there a way to automatically scroll to the bottom of a multiline textbox with a scrollbar in CF 1.0?

I would like to generate the equivalent of "scrolling output" in my CF 1.0 application, and I am using a multiline textbox to hold the text that I would like to scroll as I add more text to it.

Thanks,
Mark Rejhon

[332 byte] By [MarkRejhon] at [2008-2-20]
# 2
That certainly helped.

I have added the related changes needed (learned some new things at that web address), although I am sticking to the ScrollToCaret method for now for simplicity.

If the flicker becomes annoying, I'll use the more arcane SendMessage method suggested.

MarkRejhon at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3
I am not sure why you're calling SendMessage "arcane", but in CF v2 you don't even need to call Capture, GetCapture since the Handle is provided.
AlexY at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 4
Hi,

It is my understanding .NET CF typically avoids the need to call normal Win32 API's, so falling back to that as a workaround seemed kind of arcane, as I had never needed to call Win32 from a .NET CF -- that's what I meant by arcane. SendMessage is a very useful thing though, but it kinda seemed non-native ".NET CF" stuff... Glad that the option is there though, when it becomes an essential workaround.

In any event, it works so I am happy!

MarkRejhon at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 5
Mark,

The whole .NET CF is built on a top (wraps) Win32 API's. If you still think SendMessage is "non-native" to CF then there's managed MessageWindow.SendMessage that'll do the same.

AlexY at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...