Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: zoom in rich textbox

202| Sat, 09 Feb 2008 10:28:00 GMT| gnznroses| Comments (3)
my program uses a rich textbox, and i just noticed if i hold ctrl while i scroll with the mousewheel, that the document zooms in and out. it also works in Wordpad. so i'm guessing this is a function of RTF boxes, but i can't find a way to do it. what gives?

Keywords & Tags: zoom, rich, textbox, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560747/
 
«« Prev - Next »» 3 helpful answers below.
i can't find a way to do it. what gives?
Find a way to do what? Capture the mousewheel event or zoom the text ?
If you want to zoom the text just increase the font size.

sahir | Fri, 09 Nov 2007 20:37:00 GMT |

well, it automatically zooms, so i wouldn't be changing the font size manually. and even capturing the scroll event, that doesn't tell me how much zoomed it is. like, what percent. i figured there was a way to find all this info with api or something.

gnznroses | Fri, 09 Nov 2007 20:38:00 GMT |

I presume you need to display the zoom percentage.

1) If you want to capture the event you need to listen for WM_MOUSEWHEEL not WM_SCROLL

2) Zoom percentage can be determined from the font size. Read the current font size and calculate the zoom percentage when the text box receives a WM_MOUSEWHEEL. If the contol key is not pressed the zoom percentage will not change so you don't have to worry about the control key.

sahir | Fri, 09 Nov 2007 20:40:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories