473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RichTextBox with Zoom and alignment

1
Hi all.

I'm trying to create an application with a RichTextBox control in order to let user introduce a formatted text, and then I generate a word2007 .docx document with that text.

I added the functionality to zoom in/out in this RichTextBox, sending the EM_SETZOOM message to it.

The problem is that if I just send the message, the .SelAlignment = rtfRight goes out of the control.

To solve that, I tried to set the .width property smaller proportionally to zoom (for example, if zoom is set to 50%, write .width = .width/2. Then alignment functionality works well, but text is wrapped into more lines, without filling all width of the control (if 50% zoom, letting the first left half of the control empty).

Last try I test is to change richtextbox width via the EM_SETRECT message, but it seems not to have any effect (if I ask the rectangle dimensions after sending this EM_SETRECT message, by using EM_GETRECT message, I get exactly the same values they were before the EM_SETRECT message).

So anyone knows how I can zoom in/out with alignment functionality and wrapping text working fine?

Thank you very much in advance and excuse my english.

Gabriel.
Oct 17 '06 #1
0 2000

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Just Me | last post by:
Using a Richtextbox I use EM_SETZOOM to set a zoom factor. If I set it to 2 the image on the screen increase but not exactly by 2. I've coded a ruler above the Richtextbox which does scale by...
0
by: davide rocchelli | last post by:
I have found a probable bug when you draw with GDI. Look this simple code Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint ...
3
by: gsb58 | last post by:
Hi! I'm doing a notepad application for learning. I have a problem finding anything on how to align text left, center and right in the RichTextBox. Couldn't find any clear answer in the...
3
by: Venkatachalam | last post by:
Hello, I am reading a Column form the DataTable and have to display in the RichTextBox/TextBox (With Multi-line). When I try to do so: The width occupied by each charaters are not same and that...
0
by: murry19830507 | last post by:
i want creat an web application(c#.net),which contains an image and one radiobutton list with 3 radiobuttons(zoom in ,zoom out ,zoom window) when user checked on zoom in imge has to be zoom inthe...
0
by: Peter Duniho | last post by:
On Wed, 25 Jun 2008 03:50:36 -0700, Tony <johansson.andersson@telia.com> wrote: Did you read the documentation?...
2
by: VC | last post by:
Hi I'd like to display an imagem in a picture box, but just a portion of it Example (please ignore the dots, I use them to keep the alignment) ...
1
by: Andrus | last post by:
I need to save font selected by user by Ctrl+MouseWheel in Winforms RichTextBox. I tried override below but this does not remember font: in this method Font.Size property seems to be always...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.