Re: Problem with Rich Text Box
From: David Youngblood (dwy_at_flash.net)
Date: 01/04/05
- Next message: Les: "Re: Problem with Rich Text Box"
- Previous message: Randy Birch: "Re: Problem with Rich Text Box"
- In reply to: Randy Birch: "Re: Problem with Rich Text Box"
- Next in thread: Les: "Re: Problem with Rich Text Box"
- Reply: Les: "Re: Problem with Rich Text Box"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 Jan 2005 23:27:54 -0600
"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
> :
> :
> :
>
>
- Next message: Les: "Re: Problem with Rich Text Box"
- Previous message: Randy Birch: "Re: Problem with Rich Text Box"
- In reply to: Randy Birch: "Re: Problem with Rich Text Box"
- Next in thread: Les: "Re: Problem with Rich Text Box"
- Reply: Les: "Re: Problem with Rich Text Box"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|