🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #504

Re: RichTextBox (HowTo keep focus on bottom)

#504
From: Anonymous VB User
Date: Sat, 17 Oct 1998 00:00
43 lines
2479 bytes
stevesykes@my-dejanews.com wrote:
> 
> Try this,
> in a module place this code:
> Public Function ScrollText&(TextBox As Control, vLines As Integer)
>        #If Win32 Then
>        Dim Success As Long
>        Dim SavedWnd As Long
>        Dim r As Long
>        Const EM_LINESCROLL = &HB6
>        #Else
>        Dim Success As Integer
>        Dim SavedWnd As Integer
>        Dim r As Integer
>        Const EM_LINESCROLL = &H406
>        #End If
>        SavedWnd = Screen.ActiveForm.hwnd
>        Dim z As Long
>        Lines& = vLines
>        ' Set the focus to the passed control (text control).
>        'TextBox.SetFocus
>        ' Scroll the lines.
>        Success = SendMessage(TextBox.hwnd, EM_LINESCROLL, 0, Lines&)
>        'r = PutFocus(SavedWnd)
>        ' Return the number of lines actually scrolled.
>        ScrollText& = Success
>        End Function
> 
> To make the box scoll use this,
> Num& = ScrollText&(frmNameBox, numlines)
> numlines is the number of lines to scroll
> frmNameBox is the box to scroll
> This works on all types of text boxes

Just curious.. how would I find out how many lines are
in the textbox?  And how does the code needed to find the
number of lines affect the speed of textbox's display update?
In my project, I would expect updates occuring up to 3 times
every second, and I'd like to keep the textbox's update 
flicker to a minimum.

Thanks in advance.
-Anonymous VB User
Technical Details
Message-ID: <36281A66.6DA1@hotmail.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6s2of7$10c$1@news0-alterdial.uu.net> <3621515D.4C3A@hotmail.com> <702mic$lf8$1@nnrp1.dejanews.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1053fc,f7468dc70f59f2ab
X-Google-Attributes: gid1053fc,public
X-Google-Thread: 1212f1,f7468dc70f59f2ab
X-Google-Attributes: gid1212f1,public
X-Google-Thread: 11629a,f7468dc70f59f2ab
X-Google-Attributes: gid11629a,public
X-Google-Thread: 110e3b,f7468dc70f59f2ab
X-Google-Attributes: gid110e3b,public
From: Anonymous VB User <just_up_stairs@hotmail.com>
Subject: Re: RichTextBox (HowTo keep focus on bottom)
Date: 1998/10/17
Message-ID: <36281A66.6DA1@hotmail.com>
X-Deja-AN: 402042144
Content-Transfer-Encoding: 7bit
References: <6s2of7$10c$1@news0-alterdial.uu.net> <3621515D.4C3A@hotmail.com> <702mic$lf8$1@nnrp1.dejanews.com>
Content-Type: text/plain; charset=us-ascii
X-Trace: 17 Oct 1998 00:08:45 -0500, 208.13.202.154
Organization: Together Networks - Burlington, VT.
MIME-Version: 1.0
Newsgroups: comp.lang.basic.visual.misc,comp.lang.clipper.visual-objects,es.comp.lenguajes.visual-basic,microsoft.public.visualj.debugger