question

ARC-0178 avatar image
0 Votes"
ARC-0178 asked XingyuZhao-MSFT commented

How preserve fontsize of 2 Richtextbox or equal sizes

I have 2 richtextboxes, I increase the font size of both correctly at same time with a button with this code. The problem is: when I zoom directly on touchscreen and/or I do accidentally 2-fingered zoom on the touchpad, over one of them, it zooms too, but then I can't get back equal values pressing the button, both textboxes get diferent font size. Clicking the button continues to increase 1 point each text, but at different sizes, I must adjust manually, (doing zoom again in the same way at 2 fingers) to get back the nearest size in the moddified one.

  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

  2. RichTextBox1.Font = New Font(RichTextBox1.Font.FontFamily, RichTextBox1.Font.Size + 1,RichTextBox1.Font.Style)

  3. RichTextBox2.Font = RichTextBox1.Font

  4. End Sub


dotnet-visual-basic
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Are you interested in keeping the same zoom level for both of textboxes when one is zoomed?

0 Votes 0 ·

Yes, I try to synchronize font size and zoom in both screen boxes, the problem comes when I do two-fingered zoom at touchpad or touchscreen, (maybe also equals to zoom with mouse wheel ) I try to get back the .Zoomfactor = 1 for both richtextboxes, without luck, try it yourself: its impossible!

0 Votes 0 ·

Hi @ARC-0178 ,
Could you share your project on onedrive or github? It will help others make a test and reproduce your problem.
We are waiting for your update.

0 Votes 0 ·

Hi @ARC-0178 ,
Do you still meet this issue? Please let me know if you need further assistance.

0 Votes 0 ·

0 Answers