|
-
Nov 4th, 2005, 12:29 PM
#1
Thread Starter
Addicted Member
RichTextBox and Zoom Levels
Does anyone know how to adjust the zoom levels on a richtextbox control without having to do a .FontSize to the entire control?
I need to know how to access the same zoom levels you would get if you were to hold in your ctrl button and scrolled the wheel on your mouse.
-
Nov 4th, 2005, 04:24 PM
#2
Re: RichTextBox and Zoom Levels
There is no easy way to do this. If you want to do this (with more than just text) then you would have to write the code yourself.
The easiest way is to just change the .fontsize of everything. Why wouldn't this work for you?
EDIT: But here is a magnification glass if you are interested: http://www.vbforums.com/showthread.php?t=368322
Last edited by eyeRmonkey; Nov 4th, 2005 at 04:27 PM.
-
Nov 4th, 2005, 05:45 PM
#3
Thread Starter
Addicted Member
Re: RichTextBox and Zoom Levels
If would it stay in relation and work with the ctrl-scroll I would.
I know that there is a zoom property in RichTextBox - its actually in the coding for RTF, I just can't recall what it is and how to access it.
-
Nov 4th, 2005, 06:15 PM
#4
Re: RichTextBox and Zoom Levels
What do you mean relation? Do you have things other than text in your RTB?
Getting it to work with Ctrl+Scroll wouldn't be too hard. You would have to set a global flag for KeyPress. Although, I am not sure how you would recognize mouse-wheel scroll event. I'll do some searching and let you know if I come up with anything.
As far as a zoom property in RTF, I don't know. One way to find out would be to edit a .RTF document in WordPad and do something to change the zoom property then view the .RTF in notepad to see all the RTF formatting characters and see if you can find what RTF tag is used to zoom. After that you could edit the .TextRTF property and insert this zoom porperty.
In the long run I'm not sure its worth it because you still have to catch the mouse-wheel scroll event and if you have that you might as well change the font size.
-
Nov 4th, 2005, 06:24 PM
#5
Thread Starter
Addicted Member
Re: RichTextBox and Zoom Levels
Good idea about using the word document, I'll look into that.
The reason I want it to act with the ctrl-scroll, it because the RichTextBox control already responds to it. I need it seperate from a regular Font because I dont want the end user to have the impression he's changing the html font size (once I convert it). I just want the display to increase or decrease.
With any luck, I'll be able to grab the zoom value of the document and put it into a checkbox in the toolbar. Then the end user change it using one of the two methods. I guess a good example would be like in Internet Explorer, where you can change the text size. (View > Text Size). It changes the display, but doesn't change any of the formatting on the page.
The richtextbox would only be containing text, so there wouldn't be a need to try and resize anything else.
-
Nov 4th, 2005, 06:29 PM
#6
Thread Starter
Addicted Member
Re: RichTextBox and Zoom Levels
Ok, thanks for the help, I think I have it.
\viewscaleN Zoom level of the document; the N argument is a value representing a percentage (the default is 100).
Once I can achive what I'm looking to do, I'll post an example - incase anyone is ever looking to do the same thing.
-
Nov 4th, 2005, 06:31 PM
#7
Re: RichTextBox and Zoom Levels
You might want to look at this
RichtextBox Supported RTF Codes
-
Nov 4th, 2005, 06:34 PM
#8
Re: RichTextBox and Zoom Levels
Here is an example of a class that recognizes the middle scroll wheel: http://www.vbaccelerator.com/home/VB...er/article.asp (download the code from the link in the nav bar on the left)
-
Jan 12th, 2017, 11:49 AM
#9
Lively Member
Re: RichTextBox and Zoom Levels
I didn't find any \viewscaleN in the textrtf !!!
But I have found the way right now 
It's so easy...
Actually, The Classic Richtextbox doesn't support any Zoom property
But, if you add VBCCR13.OCX to your project, all your problems will be resolved...
There is an upgraded Richtextbox in it that also supports unicode
in the Richtextbox there is this property: .ZoomFactor
The VBCCR13.OCX has been created by @Krool and you can request @Krool to send you OR you can download its open source project from here:
http://www.vbforums.com/showthread.p...mmon-controls)
-
Jan 12th, 2017, 06:14 PM
#10
Re: RichTextBox and Zoom Levels
How are you finding these?
This thread is nearly 12 years old, and the original poster hasn't been around for nearly the same length of time, while the other respondents have been inactive for more than four years. I'm pretty sure that they have moved on from the problem in that amount of time, or at least aren't expecting an answer.
My usual boring signature: Nothing
 
-
Jan 13th, 2017, 12:53 AM
#11
Lively Member
Re: RichTextBox and Zoom Levels
 Originally Posted by Shaggy Hiker
How are you finding these?
This thread is nearly 12 years old, and the original poster hasn't been around for nearly the same length of time, while the other respondents have been inactive for more than four years. I'm pretty sure that they have moved on from the problem in that amount of time, or at least aren't expecting an answer.
And I'm sure too, but i think i must do this because a day someone like me searches internet to find a solution and my answer saves his time Time is very important... even 1 second... YOLO
-
Jan 13th, 2017, 11:26 AM
#12
Re: RichTextBox and Zoom Levels
The forum is certainly a resource, and all threads past and present do provide a benefit for anybody who is searching. But it would be much better if you not resurrect threads that are more than a few months old. For one thing, this can end up spamming anybody who was subscribed to the thread and hadn't removed the subscription. They'll get an email for each new post to the thread, including this one, which is at least occasionally unwelcome. It may well be argued that it is their fault for not unsubscribing, but it's something of a common courtesy to let the thread rest in peace once it has faded away.
My usual boring signature: Nothing
 
-
Jan 13th, 2017, 11:42 AM
#13
Lively Member
Re: RichTextBox and Zoom Levels
 Originally Posted by Shaggy Hiker
The forum is certainly a resource, and all threads past and present do provide a benefit for anybody who is searching. But it would be much better if you not resurrect threads that are more than a few months old. For one thing, this can end up spamming anybody who was subscribed to the thread and hadn't removed the subscription. They'll get an email for each new post to the thread, including this one, which is at least occasionally unwelcome. It may well be argued that it is their fault for not unsubscribing, but it's something of a common courtesy to let the thread rest in peace once it has faded away.
Please accept my apologies
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|