Re: Problem with Rich Text Box

From: David Youngblood (dwy_at_flash.net)
Date: 01/04/05


Date: Tue, 4 Jan 2005 00:17:10 -0600


"Les" <vb4@prodigy.net> wrote...
> Any recommendations for a good beginners book on them?

I will second Randy's suggestion. I visit there often.

> I do have Visual Basic 5 Win 32 API's...

Also a good source. You can find a listing (with description) of the most common
edit control messages in chapter 17. Sometimes using an API call is the only way
to work around one of these bugs.

David

> 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
> > > :
> > > :
> > > :
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: XP wont start, reporting Windows file errors
    ... I solve the password problem and tried your suggestion but it didn't fix the ... "David B." ... console and run chkdsk /r ... I want to fix my files with my original OS disk but this is a SP1 ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Cocked or not?
    ... I sure hope that was Down Under David, as that suggestion is nothing I ever ... Tactical Pistol" by Suarez. ...
    (misc.fitness.weights)
  • RE: Sort with IF functions?
    ... Wag more, bark less ... "David P." wrote: ... Thank you for the suggestion. ...
    (microsoft.public.excel.misc)
  • Re: Cocked or not?
    ... I sure hope that was Down Under David, as that suggestion is nothing I ever ... Tactical Pistol" by Suarez. ...
    (misc.fitness.weights)
  • Re: 79 vert for sale?
    ... > I'm thinking of selling my 79 vert and need a suggestion as to the best ... > method/least hassels. ... With two small exceptions the car is perfect. ... Thanks, David ...
    (rec.autos.makers.vw.aircooled)

Loading