Re: Problem with Rich Text Box

From: Les (vb4_at_prodigy.net)
Date: 01/04/05


Date: Tue, 4 Jan 2005 00:53:02 -0500

Hi David,

The only reason I posted it here was to find out why it didnt work on my OS
whereas in others it was fine. You may be right about the problem being in
the dll. Anyway I will keep you posted Dave and once again I truly thank
you for your code snippet which I intend to use. Personally you guys amaze
me how you work with these API's since I have done so little with them. I
guess I need a good basic book on familiarizing myself with working with
them. Any recommendations for a good beginners book on them? I do have
Visual Basic 5 Win 32 API's but have not done much with it yet. I am going
to test it hopefully tonight so stay tuned. Unfortunately I am working in
Windows 98 se and will let you know how it works.

Talk to you soon,

Les

"David Youngblood" <dwy@flash.net> wrote in message
news:e4nog4h8EHA.3504@TK2MSFTNGP12.phx.gbl...
> "Randy Birch" <rgb_removethis@mvps.org> wrote...
> > I can't repro that using the posted code - the selection works as
expected
> > with no scrolling unless the line is out of view...
>
> The problem does not occur on W2k nor XP, only WinMe and most likely 9x (I
don't
> have 9x to test on). Tested on vb5sp3 and vb6sp5. The problem appears to
be in
> the rich edit dll, not the ocx.
>
> David
>
> > in which case it's
> > scrolled just into view. The setting of the scrollbar property has no
effect
> > on the code, FWIW.
> >
> > --
> >
> >
> > Randy Birch
> > MS MVP Visual Basic
> > http://vbnet.mvps.org/
> >
> >
> > "Les" <vb4@prodigy.net> wrote in message
> > news:eQiLUaf8EHA.2568@TK2MSFTNGP11.phx.gbl...
> > :A developer helped me with thiscode snippet from the General Forum and
it
> > : worked the way it was intended on his machine but on mine and another
> > : gentlleman from that forum had a similar problem like mine. Can
someone
> > see
> > : if they can reproduce this problem and perhaps if a fix exists for it.
> > What
> > : happens is explained after the code snippet.
> > :
> > : Thanks for your help here. Following is the code I used.
> > :
> > : Dim t As String
> > : t = "Line 1 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 2 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 3 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 4 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 5 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 6 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 7 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 8 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 9 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 10 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 11 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 12 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 13 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 14 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 15 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 16 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 17 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 18 This is a test to see if it works"
> > : t = t & vbCrLf & "Line 19 This is a test to see if it works"
> > :
> > : RichTextBox1 = t
> > : End Sub
> > : Private Sub RichTextBox1_Click()
> > : With RichTextBox1
> > : .UpTo vbLf, False, False
> > : .Span vbCr, True, True
> > : End With
> > : ' The line the user clicked on is now highlighted; put
> > : ' whatever code you wanted to follow this action here
> > : End Sub
> > :
> > : Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
> > : Dim HighLight As Boolean
> > : With RichTextBox1
> > : Select Case KeyCode
> > : Case vbKeyUp, vbKeyDown, vbKeyPageUp, vbKeyPageDown
> > : HighLight = True
> > : Case vbKeyHome
> > : HighLight = True
> > : .SelStart = 0
> > : Case vbKeyEnd
> > : HighLight = True
> > : .SelStart = Len(.Text)
> > : End Select
> > : If HighLight Then
> > : .UpTo vbLf, False, False
> > : .Span vbCr, True, True
> > : End If
> > : End With
> > : ' The line the user clicked on is now highlighted; put
> > : ' whatever code you wanted to follow this action here
> > : End Sub
> > :
> > : Now when I run this and click on say Line 5 it pushes the list up and
> > : appears to always highlight the first line. It does select the right
line
> > : but on my machine it seems to always put the line I select at the top
of
> > the
> > : list. When I use the up or down arrows it selects again the correct
line
> > : but it moves the lines up so that the selected line is always the
first
> > : line. I hope this is clearer. Sorry for the trouble.
> > :
> > : Does this happen to you?
> > :
> > : Les
> > :
> > :
> > :
> >
> >
>
>


Loading