David McAfee
davidmcafee at gmail.com
Wed Mar 23 17:02:20 CDT 2011
I was looking at that at first, but I think it required the "console" to have focus, and I just wanted to update it. I got it working: Private Sub UpdateStatus(StatusText As String) Dim intCurrPos As Integer Dim intNumberOfVbCrLFs As Integer, intFirstVbCrLf As Integer, FoundVbCrLf As Integer intCurrPos = 1 Me.txtStatus = Me.txtStatus + StatusText & vbCrLf Do Until intCurrPos >= Len(Me.txtStatus.Value) FoundVbCrLf = InStr(intCurrPos, Me.txtStatus.Value, vbCrLf) If FoundVbCrLf Then 'found If intFirstVbCrLf = 0 Then intFirstVbCrLf = FoundVbCrLf intCurrPos = FoundVbCrLf + 2 intNumberOfVbCrLFs = intNumberOfVbCrLFs + 1 If intCurrPos > Len(Me.txtStatus.Value) Then Exit Do Else 'not found intCurrPos = intCurrPos + 1 End If Loop If intNumberOfVbCrLFs > 16 Then Me.txtStatus = Right(Me.txtStatus.Value, Len(Me.txtStatus.Value) - (intFirstVbCrLf + 1)) End Sub On Wed, Mar 23, 2011 at 2:08 PM, Rocky Smolin <rockysmolin at bchacc.com>wrote: > After adding to the text box, could you find the total length of the text > in > the text box and do a .SelStart at that position? Would that work? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee > Sent: Wednesday, March 23, 2011 2:03 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Faux console > > I'm trying to make a fake console window out of a text box to display > status > of events that are happening. > > After every update, I insert a VBCRLF. > > The trouble is, after 16 lines, the text doesn't scroll up as it does in a > DOS window. > > Is there a way to programmatically scroll the vertical scroll bar down? > > If not, I was thinking of counting the VBCRLF's and if >15, delete > everything up to the first VBCRLF. > > Does anyone have any idea (or samples) of what I am trying to do? > > Thanks, > David > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >