• Welcome to Valhalla Legends Archive.
 

rtb Issue

Started by Lenny, February 07, 2004, 08:48 PM

Previous topic - Next topic

Lenny

Whenever I minimize my richtextbox and a change occurs while it is minimized (such as an rtbAdd), all the text is pushed up for some reason when I restore the window.

The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Lobo

rtbChat.Find rtbChat.Text, 0, Len(rtbChat.Text)

Put that in your form resize sub.
Look it's a signature.

Lenny

I had not realized there was a Find function for the rtb, but after experimenting with the code you gave me and some other ideas of my own, the richtextbox still pushes all the text beyond the visible area when I restore...

I suppose this just a small problem, and in some cases a good feature.
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Lobo

Did you place the code at the end of your resize code?
Look it's a signature.

Lenny

Quote from: Lobo.iD on February 07, 2004, 10:55 PM
Did you place the code at the end of your resize code?

Yes I did, right above the End Sub
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Lobo

hmm, wierd sorry my code didn't help, it's what I always used. Good luck on finding a solution.
Look it's a signature.

Lenny

Did you have the same problem?
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Grok


Lobo

No I don't have the same problem.  Do what grok said show us some code,  we will be able to better aid your problem.
Look it's a signature.

Lenny


'Vertical
rtbChat.Height = 0.63 * Me.ScaleHeight

'Horizontal
rtbChat.Width = Me.ScaleWidth - 2955


This is the form resize for my rtb...
the .63 is the scale relative to the actual form (.63 : 1)
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Grok

Oh boy!  Two whole lines.  Someone with ESP will have to help you.

Newby

At the end of your function.

Put something like

rtb.SetStart = Len(rtb.Text)

That should help =|
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Lenny


Public Sub rtbAdd(ParamArray Elements() As Variant)
   rtbTimeStamp "[" & Format(Time, "hh:mm:ss") & "] ", vbWhite
   Dim i As Integer
       For i = LBound(Elements) To UBound(Elements) Step 2
           With rtbChat
               .SelStart = Len(.text)
               .SelLength = 0
               .SelColor = Elements(i + 1)
               .SelText = Elements(i)
               .SelStart = Len(.text)
           End With
       Next i
End Sub
Public Sub rtbTimeStamp(ByVal txtOne As String, ByVal clrOne As Long)
   With rtbChat
       .SelStart = Len(.text)
       .SelLength = 0
       .SelColor = clrOne
       .SelText = txtOne
   End With
End Sub

My rtbAdd function...
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Lobo

The rtbAdd code should not result in the problem your haveing, post your resize code, also set a breakpoint on the code I gave you to put in, see if it is ever executed.
Look it's a signature.

Lenny

#14
The resize code I posted earlier is the only code I have for my rtb right now...


rtbChat.Height = 0.63 * Me.ScaleHeight


When I disable this, the rtb works normally as it should, perhaps you can't use this kind of syntax for setting height...Its unfortunate, I thought I had found an easier way to deal with resizing controls through the use of ratios
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.