Results 1 to 5 of 5

Thread: [RESOLVED] Problem with RichTextBox zoom factor.

  1. #1

    Thread Starter
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Resolved [RESOLVED] Problem with RichTextBox zoom factor.

    Hi all, I have a problem with the RichTextBox on my form. The problem is that the zoom factor of the RichTextBox control does not work if I call the "Display()" sub more than ones. Does any one know what would be the problem? Here is the sub I am using to set the text on the control.
    VB Code:
    1. Private Sub Display()
    2.         ' Enable users to select entire word when double clicked.
    3.         DisplayRTB.AutoWordSelection = True
    4.         ' Clear contents of control.
    5.         DisplayRTB.Clear()
    6.         ' Set the text for the control.
    7.         DisplayRTB.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"
    8.         ' Zoom by 4 points.
    9.         DisplayRTB.ZoomFactor = CSng(4)
    10.  End Sub

  2. #2

    Thread Starter
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: Problem with RichTextBox zoom factor.

    I resolved this problem and decided to post the solution for anyone that might need it. This is a very weird problem and it might be considered to be fixed in the future V.S. versions. The solution was solved by setting the RichTextBox.ZoomFactor property to 1 after the RichTextBox.Clear method call and then setting the RichTextBox.ZoomFactor to any number.
    VB Code:
    1. Private Sub Display()
    2.         ' Enable users to select entire word when double clicked.
    3.         DisplayRTB.AutoWordSelection = True
    4.         ' Clear contents of control.
    5.         DisplayRTB.Clear()
    6.        [B] DisplayRTB.ZoomFactor = CSng(1)[/B]
    7.         ' Set the text for the control.
    8.         DisplayRTB.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"
    9.         ' Zoom by 4 points.
    10.         DisplayRTB.ZoomFactor = CSng(4)
    11.  End Sub

  3. #3
    Addicted Member phenom's Avatar
    Join Date
    Apr 2006
    Location
    UAE
    Posts
    233

    Re: [RESOLVED] Problem with RichTextBox zoom factor.

    Well done...

    Regards,
    =======================================
    If I helped you, Kindly Rate my post. Thanks
    -----------
    PHENOM

  4. #4
    New Member
    Join Date
    Apr 2012
    Posts
    1

    Re: Problem with RichTextBox zoom factor.

    Well done, it works.

    With hundreds of programmers in Microsoft its people like you who find nasty bugs!!

    Thanks.

  5. #5
    New Member
    Join Date
    Mar 2021
    Posts
    1

    Re: [RESOLVED] Problem with RichTextBox zoom factor.

    2021 !!!
    The bug still exists on C# (which is .Net too)
    disgusting..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width