Text box using rich edit control

Hi,

I have implemented a text box using CRichEditCtrl child window in a
CView based application. I am facing a problem with zoom in and zoom
out functionality with respect to text box.

I am setting the current zoom level of CRichEditCtrl same as that of
CView. I have wrap text on for the text box and the text in the text
box repositions itself in different ways at different zoom levels. For
example, if I have a text box of width 300 pixels wide, and I have
wrapped text in 5 lines at 100% zoom, same text is now shown in the
same way at 50% zoom. It gets wrapped at different places and is
getting shown in 4 lines. But, what I need is that text should remain
static across all zoom levels, it should not alter its position.

If anyone has faced similar situation and able to solve it, then
please let me know how you are able to make it work.

In MS Word, text box that is  inserted using Insert -> Text Box
command behaves perfectly fine. How to get such functionality?

To summarize, how can I get WYSIWYG text box using CRichEditCtrl
across all zoom levels?

thanks for your help
0
somefoobar (26)
12/18/2008 9:52:22 AM
vc.mfc 33608 articles. 0 followers. Follow

11 Replies
910 Views

Similar Articles

[PageSpeed] 3

Is there a reason why you are not using CRichEditView?

Explain what you mean by zooming, and what its purpose is. Are you talking 
about using EM_SETZOOM.

Do you have any code?

AliR.


"foobar" <somefoobar@gmail.com> wrote in message 
news:aa5c85a9-760c-479d-a653-934f330289f6@e1g2000pra.googlegroups.com...
> Hi,
>
> I have implemented a text box using CRichEditCtrl child window in a
> CView based application. I am facing a problem with zoom in and zoom
> out functionality with respect to text box.
>
> I am setting the current zoom level of CRichEditCtrl same as that of
> CView. I have wrap text on for the text box and the text in the text
> box repositions itself in different ways at different zoom levels. For
> example, if I have a text box of width 300 pixels wide, and I have
> wrapped text in 5 lines at 100% zoom, same text is now shown in the
> same way at 50% zoom. It gets wrapped at different places and is
> getting shown in 4 lines. But, what I need is that text should remain
> static across all zoom levels, it should not alter its position.
>
> If anyone has faced similar situation and able to solve it, then
> please let me know how you are able to make it work.
>
> In MS Word, text box that is  inserted using Insert -> Text Box
> command behaves perfectly fine. How to get such functionality?
>
> To summarize, how can I get WYSIWYG text box using CRichEditCtrl
> across all zoom levels?
>
> thanks for your help 


0
AliR3470 (3235)
12/18/2008 4:21:07 PM
On Dec 18, 9:21=A0pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Is there a reason why you are not using CRichEditView?

Are you asking why CRichEditCtrl was picked over CRichEditView?

>
> Explain what you mean by zooming, and what its purpose is. Are you talkin=
g
> about using EM_SETZOOM.

Yes, I am using EM_SETZOOM message to set zoom level of CRichEditCtrl.

>
> Do you have any code?

Following is the relevant code from my sample application

///////////////////////////////////////////////////////////////////////////=
//////////////////////////////////////////////
// For this sample I am working with rectangle of size 300 x 100 at
100% zoom

int nZoom  =3D pView->GetZoom();

int l,t,r,b;
l =3D 0;
t =3D 0;
r =3D 300 * nZoom / 100;
b =3D 100 * nZoom / 100;

rcEditRect.SetRect(l, t, r, b);

::SendMessage(m_pRichEdit->m_hWnd, EM_SETZOOM, (WPARAM)nZoom, (LPARAM)
100);

m_pRichEdit->MoveWindow(&rcEditRect);
m_pRichEdit->ShowWindow(SW_SHOW);
///////////////////////////////////////////////////////////////////////////=
//////////////////////////////////////////////

With above setup, I was expecting that text inside the rich edit
control remains same across all zoom levels.
But I was wrong. I am not sure, why wrapping of text is happening at
different places at different zoom levels.

How can I get a rich text box which keeps text static across all zoom
levels?

Thanks in advance for any help.

>
> AliR.
>
> "foobar" <somefoo...@gmail.com> wrote in message
>
> news:aa5c85a9-760c-479d-a653-934f330289f6@e1g2000pra.googlegroups.com...
>
> > Hi,
>
> > I have implemented a text box using CRichEditCtrl child window in a
> > CView based application. I am facing a problem with zoom in and zoom
> > out functionality with respect to text box.
>
> > I am setting the current zoom level of CRichEditCtrl same as that of
> > CView. I have wrap text on for the text box and the text in the text
> > box repositions itself in different ways at different zoom levels. For
> > example, if I have a text box of width 300 pixels wide, and I have
> > wrapped text in 5 lines at 100% zoom, same text is now shown in the
> > same way at 50% zoom. It gets wrapped at different places and is
> > getting shown in 4 lines. But, what I need is that text should remain
> > static across all zoom levels, it should not alter its position.
>
> > If anyone has faced similar situation and able to solve it, then
> > please let me know how you are able to make it work.
>
> > In MS Word, text box that is =A0inserted using Insert -> Text Box
> > command behaves perfectly fine. How to get such functionality?
>
> > To summarize, how can I get WYSIWYG text box using CRichEditCtrl
> > across all zoom levels?
>
> > thanks for your help

0
somefoobar (26)
12/18/2008 5:10:30 PM
"foobar" <somefoobar@gmail.com> wrote in message 
news:241e50d8-099e-4f7f-be63-b1b56f188465@i20g2000prf.googlegroups.com...
On Dec 18, 9:21 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>> Is there a reason why you are not using CRichEditView?

>Are you asking why CRichEditCtrl was picked over CRichEditView?

Yes that is what I was asking.  I wanted to know the relationship between 
the view and the edit control?

What is the relationship between the view's zoom and the edit's zoom?

The reason I'm asking these questions, is because I don't understand what 
you are asking for?

When you call EM_SETZOOM, the edit control will change the size of the text. 
If you want the text to be wrapped in the same exact place between the zoom 
levels then you will need to change the size of the edit control by the zoom 
factor.

AliR.


0
AliR3470 (3235)
12/18/2008 5:22:53 PM
Hi, Thanks for your comment. Please see my response below.

On Dec 18, 10:22=A0pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> >> Is there a reason why you are not using CRichEditView?
> >Are you asking why CRichEditCtrl was picked over CRichEditView?
>
> Yes that is what I was asking. =A0I wanted to know the relationship betwe=
en
> the view and the edit control?

The edit control is a child window of view. The CView in my sample
displays many other elements such as images, lines, polygons, etc.
Rich text box is one such element. I am not sure if CRichEditView can
be used instead.

> What is the relationship between the view's zoom and the edit's zoom?

All elements that are present on the view in my application should
respect the zoom value set for the view.
A common analogue is MS Word application and text box in the word
document.

> The reason I'm asking these questions, is because I don't understand what
> you are asking for?

I hope that by giving MS Word analogue for zoom functionality, I am
clear now.

> When you call EM_SETZOOM, the edit control will change the size of the te=
xt.
> If you want the text to be wrapped in the same exact place between the zo=
om
> levels then you will need to change the size of the edit control by the z=
oom
> factor.

Exactly. In the code excerpt that I sent in my previous post, I am
changing the size of the
rectangle before calling MoveWindow. I am not able to figure out where
I am doing the mistake.

Thanks again for any help.

>
> AliR.

0
somefoobar (26)
12/18/2008 5:40:41 PM
Ok I get it now.

Well as far as your window resizing code goes:
I don't know what GetZoom returns, but when you are calculating the 
rectangle based on the zoom, you are working with ints instead of doubles, 
so Width and Height would probably have a 0 value, assuming that nZoom has a 
value less than 100.

Anyway, this might work a little better
r = (int)(300 * nZoom / 100.0);
b = (int)(100 * nZoom / 100.0);

Do you simply want to display the content of the edit control on the view, 
or do you have to have the actual edit control on there?

AliR.


"foobar" <somefoobar@gmail.com> wrote in message 
news:d4646cee-11da-4633-afc1-417e78865eed@z27g2000prd.googlegroups.com...
Hi, Thanks for your comment. Please see my response below.

On Dec 18, 10:22 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> >> Is there a reason why you are not using CRichEditView?
> >Are you asking why CRichEditCtrl was picked over CRichEditView?
>
> Yes that is what I was asking. I wanted to know the relationship between
> the view and the edit control?

The edit control is a child window of view. The CView in my sample
displays many other elements such as images, lines, polygons, etc.
Rich text box is one such element. I am not sure if CRichEditView can
be used instead.

> What is the relationship between the view's zoom and the edit's zoom?

All elements that are present on the view in my application should
respect the zoom value set for the view.
A common analogue is MS Word application and text box in the word
document.

> The reason I'm asking these questions, is because I don't understand what
> you are asking for?

I hope that by giving MS Word analogue for zoom functionality, I am
clear now.

> When you call EM_SETZOOM, the edit control will change the size of the 
> text.
> If you want the text to be wrapped in the same exact place between the 
> zoom
> levels then you will need to change the size of the edit control by the 
> zoom
> factor.

Exactly. In the code excerpt that I sent in my previous post, I am
changing the size of the
rectangle before calling MoveWindow. I am not able to figure out where
I am doing the mistake.

Thanks again for any help.

>
> AliR.


0
AliR3470 (3235)
12/18/2008 5:47:04 PM
On Dec 18, 10:47=A0pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Ok I get it now.
>
> Well as far as your window resizing code goes:
> I don't know what GetZoom returns, but when you are calculating the
> rectangle based on the zoom, you are working with ints instead of doubles=
,
> so Width and Height would probably have a 0 value, assuming that nZoom ha=
s a
> value less than 100.
>
> Anyway, this might work a little better
> r =3D (int)(300 * nZoom / 100.0);
> b =3D (int)(100 * nZoom / 100.0);

Just to focus on this zoom issue exclusively I am working on the
sample application.
For this sample it is guaranteed that GetZoom returns value greater
than equal to 50.
In fact I am changing zoom from 50 to 100 to 200 only and still I
could see that text is not remaining same
across zoom levels.

>
> Do you simply want to display the content of the edit control on the view=
,
> or do you have to have the actual edit control on there?

I need to display the content as well. When clicked on the box the
actual edit control should be shown.
But, again to exclusively focus on one issue currently I am always
showing actual edit control.

>
> AliR.
>
> "foobar" <somefoo...@gmail.com> wrote in message
>
> news:d4646cee-11da-4633-afc1-417e78865eed@z27g2000prd.googlegroups.com...
> Hi, Thanks for your comment. Please see my response below.
>
> On Dec 18, 10:22 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>
> > >> Is there a reason why you are not using CRichEditView?
> > >Are you asking why CRichEditCtrl was picked over CRichEditView?
>
> > Yes that is what I was asking. I wanted to know the relationship betwee=
n
> > the view and the edit control?
>
> The edit control is a child window of view. The CView in my sample
> displays many other elements such as images, lines, polygons, etc.
> Rich text box is one such element. I am not sure if CRichEditView can
> be used instead.
>
> > What is the relationship between the view's zoom and the edit's zoom?
>
> All elements that are present on the view in my application should
> respect the zoom value set for the view.
> A common analogue is MS Word application and text box in the word
> document.
>
> > The reason I'm asking these questions, is because I don't understand wh=
at
> > you are asking for?
>
> I hope that by giving MS Word analogue for zoom functionality, I am
> clear now.
>
> > When you call EM_SETZOOM, the edit control will change the size of the
> > text.
> > If you want the text to be wrapped in the same exact place between the
> > zoom
> > levels then you will need to change the size of the edit control by the
> > zoom
> > factor.
>
> Exactly. In the code excerpt that I sent in my previous post, I am
> changing the size of the
> rectangle before calling MoveWindow. I am not able to figure out where
> I am doing the mistake.
>
> Thanks again for any help.
>
>
>
> > AliR.

0
somefoobar (26)
12/18/2008 5:59:25 PM
I looked at some old code where I was doing zooms on edit controls, and I 
noticed that I had to do some fudging on the zoom to get it to work 
correctly.
m_RichEdit.SendMessage(EM_SETZOOM,(Zoom/100)*985,1000);


Don't ask me where I came up with 985, I think I did some trial an error.
I have some code for drawing the content of a richedit control on a DC using 
scaling, that one uses the system metrics to come up with the fudge factor.

try this sample and let me know if this is what you wanted, and if not then 
tell me what it does wrong:
http://www.learnstar.com/AliR/RichEditZoom.zip

Run the exe and put a number in the little edit box (50, 100, 200...) and 
press zoom.

AliR.



"foobar" <somefoobar@gmail.com> wrote in message 
news:1a51fbe8-de4d-4bc0-992f-c7b31ee2cd4f@r15g2000prh.googlegroups.com...
On Dec 18, 10:47 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Ok I get it now.
>
> Well as far as your window resizing code goes:
> I don't know what GetZoom returns, but when you are calculating the
> rectangle based on the zoom, you are working with ints instead of doubles,
> so Width and Height would probably have a 0 value, assuming that nZoom has 
> a
> value less than 100.
>
> Anyway, this might work a little better
> r = (int)(300 * nZoom / 100.0);
> b = (int)(100 * nZoom / 100.0);

Just to focus on this zoom issue exclusively I am working on the
sample application.
For this sample it is guaranteed that GetZoom returns value greater
than equal to 50.
In fact I am changing zoom from 50 to 100 to 200 only and still I
could see that text is not remaining same
across zoom levels.

>
> Do you simply want to display the content of the edit control on the view,
> or do you have to have the actual edit control on there?

I need to display the content as well. When clicked on the box the
actual edit control should be shown.
But, again to exclusively focus on one issue currently I am always
showing actual edit control.

>
> AliR.
>
> "foobar" <somefoo...@gmail.com> wrote in message
>
> news:d4646cee-11da-4633-afc1-417e78865eed@z27g2000prd.googlegroups.com...
> Hi, Thanks for your comment. Please see my response below.
>
> On Dec 18, 10:22 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>
> > >> Is there a reason why you are not using CRichEditView?
> > >Are you asking why CRichEditCtrl was picked over CRichEditView?
>
> > Yes that is what I was asking. I wanted to know the relationship between
> > the view and the edit control?
>
> The edit control is a child window of view. The CView in my sample
> displays many other elements such as images, lines, polygons, etc.
> Rich text box is one such element. I am not sure if CRichEditView can
> be used instead.
>
> > What is the relationship between the view's zoom and the edit's zoom?
>
> All elements that are present on the view in my application should
> respect the zoom value set for the view.
> A common analogue is MS Word application and text box in the word
> document.
>
> > The reason I'm asking these questions, is because I don't understand 
> > what
> > you are asking for?
>
> I hope that by giving MS Word analogue for zoom functionality, I am
> clear now.
>
> > When you call EM_SETZOOM, the edit control will change the size of the
> > text.
> > If you want the text to be wrapped in the same exact place between the
> > zoom
> > levels then you will need to change the size of the edit control by the
> > zoom
> > factor.
>
> Exactly. In the code excerpt that I sent in my previous post, I am
> changing the size of the
> rectangle before calling MoveWindow. I am not able to figure out where
> I am doing the mistake.
>
> Thanks again for any help.
>
>
>
> > AliR.


0
AliR3470 (3235)
12/18/2008 6:31:27 PM
Hi, Thanks for the comment. I really appreciate your kind response to
help me. It did not solve my problem.

I tried your tool with following input

/////////////////
This is a test this is only a test.  If this was not a test then it l
l l l l l l l l l l l ll L l lhabeen the real thing.  But like I said
earlier this is only a test so don't l l l l panic!!!
/////////////////

I just added a few alphabets and spaces to default input that you had.
At 100%, second line was starting with capital
case L, but at 90% that alphabet L has moved to somewhere else.

That is exactly the problem that I am facing.



On Dec 18, 11:31=A0pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> I looked at some old code where I was doing zooms on edit controls, and I
> noticed that I had to do some fudging on the zoom to get it to work
> correctly.
> m_RichEdit.SendMessage(EM_SETZOOM,(Zoom/100)*985,1000);
>
> Don't ask me where I came up with 985, I think I did some trial an error.
> I have some code for drawing the content of a richedit control on a DC us=
ing
> scaling, that one uses the system metrics to come up with the fudge facto=
r.
>
> try this sample and let me know if this is what you wanted, and if not th=
en
> tell me what it does wrong:http://www.learnstar.com/AliR/RichEditZoom.zip
>
> Run the exe and put a number in the little edit box (50, 100, 200...) and
> press zoom.
>
> AliR.
>
> "foobar" <somefoo...@gmail.com> wrote in message
>
> news:1a51fbe8-de4d-4bc0-992f-c7b31ee2cd4f@r15g2000prh.googlegroups.com...
> On Dec 18, 10:47 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>
> > Ok I get it now.
>
> > Well as far as your window resizing code goes:
> > I don't know what GetZoom returns, but when you are calculating the
> > rectangle based on the zoom, you are working with ints instead of doubl=
es,
> > so Width and Height would probably have a 0 value, assuming that nZoom =
has
> > a
> > value less than 100.
>
> > Anyway, this might work a little better
> > r =3D (int)(300 * nZoom / 100.0);
> > b =3D (int)(100 * nZoom / 100.0);
>
> Just to focus on this zoom issue exclusively I am working on the
> sample application.
> For this sample it is guaranteed that GetZoom returns value greater
> than equal to 50.
> In fact I am changing zoom from 50 to 100 to 200 only and still I
> could see that text is not remaining same
> across zoom levels.
>
>
>
> > Do you simply want to display the content of the edit control on the vi=
ew,
> > or do you have to have the actual edit control on there?
>
> I need to display the content as well. When clicked on the box the
> actual edit control should be shown.
> But, again to exclusively focus on one issue currently I am always
> showing actual edit control.
>
>
>
> > AliR.
>
> > "foobar" <somefoo...@gmail.com> wrote in message
>
> >news:d4646cee-11da-4633-afc1-417e78865eed@z27g2000prd.googlegroups.com..=
..
> > Hi, Thanks for your comment. Please see my response below.
>
> > On Dec 18, 10:22 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>
> > > >> Is there a reason why you are not using CRichEditView?
> > > >Are you asking why CRichEditCtrl was picked over CRichEditView?
>
> > > Yes that is what I was asking. I wanted to know the relationship betw=
een
> > > the view and the edit control?
>
> > The edit control is a child window of view. The CView in my sample
> > displays many other elements such as images, lines, polygons, etc.
> > Rich text box is one such element. I am not sure if CRichEditView can
> > be used instead.
>
> > > What is the relationship between the view's zoom and the edit's zoom?
>
> > All elements that are present on the view in my application should
> > respect the zoom value set for the view.
> > A common analogue is MS Word application and text box in the word
> > document.
>
> > > The reason I'm asking these questions, is because I don't understand
> > > what
> > > you are asking for?
>
> > I hope that by giving MS Word analogue for zoom functionality, I am
> > clear now.
>
> > > When you call EM_SETZOOM, the edit control will change the size of th=
e
> > > text.
> > > If you want the text to be wrapped in the same exact place between th=
e
> > > zoom
> > > levels then you will need to change the size of the edit control by t=
he
> > > zoom
> > > factor.
>
> > Exactly. In the code excerpt that I sent in my previous post, I am
> > changing the size of the
> > rectangle before calling MoveWindow. I am not able to figure out where
> > I am doing the mistake.
>
> > Thanks again for any help.
>
> > > AliR.

0
somefoobar (26)
12/18/2008 7:00:02 PM
Sorry dude, that's as close as I can get it.

If you decide to draw the RTF on the screen instead of creating a Rich Edit 
control and resizing it, then you might want to look at this:
http://www.learnstar.com/AliR/RTFScaler3.zip


AliR.

"foobar" <somefoobar@gmail.com> wrote in message 
news:aa5c85a9-760c-479d-a653-934f330289f6@e1g2000pra.googlegroups.com...
> Hi,
>
> I have implemented a text box using CRichEditCtrl child window in a
> CView based application. I am facing a problem with zoom in and zoom
> out functionality with respect to text box.
>
> I am setting the current zoom level of CRichEditCtrl same as that of
> CView. I have wrap text on for the text box and the text in the text
> box repositions itself in different ways at different zoom levels. For
> example, if I have a text box of width 300 pixels wide, and I have
> wrapped text in 5 lines at 100% zoom, same text is now shown in the
> same way at 50% zoom. It gets wrapped at different places and is
> getting shown in 4 lines. But, what I need is that text should remain
> static across all zoom levels, it should not alter its position.
>
> If anyone has faced similar situation and able to solve it, then
> please let me know how you are able to make it work.
>
> In MS Word, text box that is  inserted using Insert -> Text Box
> command behaves perfectly fine. How to get such functionality?
>
> To summarize, how can I get WYSIWYG text box using CRichEditCtrl
> across all zoom levels?
>
> thanks for your help 


0
AliR3470 (3235)
12/18/2008 8:06:43 PM
Hi,

Any idea how MS Word or for that matter many other drawing tools
implement text boxes. It seems, all most all got it correctly. Is
there any thing else than CRichEditCtrl that should be used for rich
text box?

Can any one answer please?

thanks


On Dec 19, 1:06=A0am, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Sorry dude, that's as close as I can get it.
>
> If you decide to draw the RTF on the screen instead of creating a Rich Ed=
it
> control and resizing it, then you might want to look at this:http://www.l=
earnstar.com/AliR/RTFScaler3.zip
>
> AliR.
>
> "foobar" <somefoo...@gmail.com> wrote in message
>
> news:aa5c85a9-760c-479d-a653-934f330289f6@e1g2000pra.googlegroups.com...
>
> > Hi,
>
> > I have implemented a text box using CRichEditCtrl child window in a
> > CView based application. I am facing a problem with zoom in and zoom
> > out functionality with respect to text box.
>
> > I am setting the current zoom level of CRichEditCtrl same as that of
> > CView. I have wrap text on for the text box and the text in the text
> > box repositions itself in different ways at different zoom levels. For
> > example, if I have a text box of width 300 pixels wide, and I have
> > wrapped text in 5 lines at 100% zoom, same text is now shown in the
> > same way at 50% zoom. It gets wrapped at different places and is
> > getting shown in 4 lines. But, what I need is that text should remain
> > static across all zoom levels, it should not alter its position.
>
> > If anyone has faced similar situation and able to solve it, then
> > please let me know how you are able to make it work.
>
> > In MS Word, text box that is =A0inserted using Insert -> Text Box
> > command behaves perfectly fine. How to get such functionality?
>
> > To summarize, how can I get WYSIWYG text box using CRichEditCtrl
> > across all zoom levels?
>
> > thanks for your help

0
somefoobar (26)
12/18/2008 8:33:45 PM
They do their own layout.  Usually in TWIPS coordinates.  Look at a Word document, and you
will see that the character spacing is sometimes
	i rregular
	ir regular
	irr egu lar
and that is the pixel roundoff as TWIPS convert back to pixels.  but by using a fixed
coordinate system for the layout, scaling is applied as a separate operation.  So they
have complete layout control and can do exactly the same thing every time.  Rich edit
controls do not work this way.
				joe

On Thu, 18 Dec 2008 12:33:45 -0800 (PST), foobar <somefoobar@gmail.com> wrote:

>
>Hi,
>
>Any idea how MS Word or for that matter many other drawing tools
>implement text boxes. It seems, all most all got it correctly. Is
>there any thing else than CRichEditCtrl that should be used for rich
>text box?
>
>Can any one answer please?
>
>thanks
>
>
>On Dec 19, 1:06�am, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
>> Sorry dude, that's as close as I can get it.
>>
>> If you decide to draw the RTF on the screen instead of creating a Rich Edit
>> control and resizing it, then you might want to look at this:http://www.learnstar.com/AliR/RTFScaler3.zip
>>
>> AliR.
>>
>> "foobar" <somefoo...@gmail.com> wrote in message
>>
>> news:aa5c85a9-760c-479d-a653-934f330289f6@e1g2000pra.googlegroups.com...
>>
>> > Hi,
>>
>> > I have implemented a text box using CRichEditCtrl child window in a
>> > CView based application. I am facing a problem with zoom in and zoom
>> > out functionality with respect to text box.
>>
>> > I am setting the current zoom level of CRichEditCtrl same as that of
>> > CView. I have wrap text on for the text box and the text in the text
>> > box repositions itself in different ways at different zoom levels. For
>> > example, if I have a text box of width 300 pixels wide, and I have
>> > wrapped text in 5 lines at 100% zoom, same text is now shown in the
>> > same way at 50% zoom. It gets wrapped at different places and is
>> > getting shown in 4 lines. But, what I need is that text should remain
>> > static across all zoom levels, it should not alter its position.
>>
>> > If anyone has faced similar situation and able to solve it, then
>> > please let me know how you are able to make it work.
>>
>> > In MS Word, text box that is �inserted using Insert -> Text Box
>> > command behaves perfectly fine. How to get such functionality?
>>
>> > To summarize, how can I get WYSIWYG text box using CRichEditCtrl
>> > across all zoom levels?
>>
>> > thanks for your help
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
12/19/2008 7:06:42 PM
Reply:

Similar Artilces:

TEXT = text
I have some data in an Excel table which uses case sensitive codes. Does anyone know of a way to perform case sensitive VLookups. Example. A1 contains "TEXT", A2 contains "One". B1 contains "text", B2 contains "Two" If I enter "text" in cell A4 and the following VLookup in B4: =VLOOKUP(A4;A1:B2;2;FALSE) I get the answer "One", but I would like to see "Two". I have found a work around by converting a number of characters to their ASCII codes, but this is very messy. I know that the FIND function is case sensitive whe...

Adding rows using macro
This is my first macro! (Excel 97 running under Windows 2000.) I have a form that I want to add rows (one row at a time) after the current row. The form allows businesses to send in changes to their products. They may have 1 or 100 products that need to be updated. We want the form to initially have one row for them to enter their information. If they have another product, then we want a row to be added automatically after the current row. It looks like this: A B C D E 1 Product Name Size Quantity Curr. Price New Price 2 Popso 1L 5 cases $20.00 $25.00 Since Exce...

What is the Limit of Text Boxes & Labels a User Form can have?
What is the Max File Size a User Form can be? I have Windows 7 with Office 2007. Does it have like a 64K limit? The file size as far as kb. My entire Program is 1,203 Kb. When I ran it I got a "compile Error out of memory", so I exported my User Form. Then I looked at the file size of just the User Form in a blank Workbook 34 KB = .frm 219 KB = frx My user Form is a Multi Page with 4 Pages on it. There are alot of text boxes and labels on the 4 sheets. Is there a limit to the number of text boxes & labels you can have in a user Form? I have 12 GB of ...

Selecting text in a document
Hi, I have a macro which finds a certain piece of text in the document and then moves down a line and then selects all the text between that and the end of the document and the selected text is later sent out in an email. This has been working for some time but I have recently had some problems because the text is not being selected as before (extendmode on?) and I am sending out blank emails. The code fragment that I use to select the text is as follows Selection.HomeKey wdStory Selection.Find.Execute "Issued at" Selection.MoveDo...

Resizing cells to fit text returned by VLOOKUP
I have some VLOOKUPs which sometimes return 50 or 60 characters (they're in merged cells). I want the text to wrap, and the cell to enlarge to fit the text - Just like it does whan you type it in, but somehow, because it is being returned from a formula it just displays the bottom line of the wrapped text, and doesn't resize the row. Anyone know how I cam make it fit? I'm happy to use a VBA solution if there's no built in way to make it happen automatically. Thanks M Would you mind to limit your request to ONE newsgroup? Joerg "Michelle" <mh_londonNOJUN...

CScrollView and text height
I call DrawText to draw text on the CScrollView.When text has multi-line,how do I get the screen height to draw them? Thanks. ___________________________________ http://www.msale.net/bbs a Chinese-language message board for developers,including palm,ppc,symbian,and etc. http://www.zirong.net/blog/ Miken's private life If you are trying to calculate the height of a multiline string user DrawText with the DT_CALCRECT flag. It will use the width of the Rect that you pass it, and sets the bottom of the rect to what the bottom would be if you draw it. AliR. "Miken" <mikenwon...

Rich Textbox
I'm wanting to add a Rich Textbox to my Excel sheet. I found this, but don't know what to do from here. http://msdn2.microsoft.com/library/72z2h2cz(en-us,vs.80).aspx I have a simple textbox control on my sheet but I'd like to add some formatting so my thought was a Rich Textbox. If there is a different solution I'm open to that as well. Use a textbox from the Drawing toolbar. It supports richtext formatting and it is native to Excel. -- Regards, Tom Ogilvy "M.Siler" <John.Doe@NoSpam.com> wrote in message news:OU9mIsKUFHA.3392@TK2MSFTNGP12.phx.gbl.....

Text Boxes on Charts not showing up
Has anyone experienced this? I've got a chart in a spreadsheet and I add text boxes to the graph section. They appear on the page yet when I click off the page, the text box disappears. If I go to print preview, the text boxes are there so why can't I see them on the screen? I've tried the bring forward command but that didn't work. This is also sporadic as some of my text boxes stay in place why others seem to disappear. Sue - If the chart is selected when you draw the text box, the text box becomes part of the chart. If not, the text box just floats along in the dr...

avoid losing text when text submission timed out?
Often I have to log in to some web site to enter a few paragraphs of text (e.g. web email submission, user forum, product reviews, etc). Sometimes it takes me a while to compose the text, and by the time I click submit, I get a response saying the session has timed out, and the text that took me a long time to compose is gone. Is there a way to retrieve this text? Clicking the back button doesn't work. Perhaps it is in a cache somewhere? The portion of the web page containing your text may or may not be in TIF, but here's what I do: Before I hit the 'Submit'...

Ranking Numbers with Text
I am trying to sort a list of serial numbers containing alpha an numeric text into ascending order so LOOKUP will work. ie: 5KJJAHAS63PL84681 input into col. E 5KJJAHAS43PL84685 5KJJAHASx3PL84683 5KJJAHAS83PL84686 5KJJAHAS63PL84689 5KJJAHAS43PL84684 5KJJAHAS23PL84682 5KJJAHAS03PL84688 5KJJAHASx3PL84610 5KJJAHAS83PL84690 5KJJAHAS83PL84691 Only the ninth and 13 thru 17 digits change. Worksheets are protected except for inputs. I need the sort to use the LOOKUP function. I tried =IF(E3>0,(RIGHT(E3,5)*1),999999) to RANK by the last 5 =RANK(D3,D$3:D$102,1)+COUNTIF(D$3:D3,D3)-1, but then LOOKUP ...

Is there a command line string I can use to send email?
If I can send email from a command prompt I can figure out a way to do a mass email to a list of people volunteering for something where I work - the list changes daily. Sandra <ab@mdahospital.com> wrote: > If I can send email from a command prompt I can figure out a way to > do a mass email to a list of people volunteering for something where > I work - the list changes daily. Check the tools here: http://www.slipstick.com/addins/mail.htm#massmail -- Brian Tillman ...

Null in text box
Can anyone see what might be wrong withthis procedure? Private Sub Job_Number_BeforeUpdate(Cancel As Integer) If IsNull(Me.Job_Number) = True Then MsgBox "No Job Number Entered" Cancel = True End If End Sub -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200707/1 "Haggr1 via AccessMonster.com" <u35393@uwe> wrote in news:74fa8171f7137@uwe: > Can anyone see what might be wrong withthis procedure? > > Private Sub Job_Number_BeforeUpdate(Cancel As Integer) > > If IsNull(Me.Job_...

I TYPE IN A TEXT BOX AND IT COPIES THE TEXT TO OTHER TEXT BOXES
Does anyone know how to fix this? Shari wrote: > Does anyone know how to fix this? ================================ Are you editing text on the Master page? -- John Inzer MS Picture It! - Digital Image MVP Digital Image Highlights and FAQs http://support.microsoft.com/ph/695 Notice This is not tech support I am a volunteer Solutions that work for me may not work for you Proceed at your own risk Yes, I thinnk so. :-) I'm not on the background. It's an 8 pg brochure I'm creating and it didn't do it before I added page 8. ...

convert text case in same column or row?
How do I convert text case in the same colum or row. At the moment I use UPPER, but have to create a new column/row. You may find this to be handy Sub ChangeCase() 'Don Guillett Application.ScreenUpdating = False Dim r As Range nCase = UCase(InputBox("Enter U for UPPER" & Chr$(13) & " L for lower" & Chr$(13) & " Or " & Chr$(13) & " P for Proper", "Select Case Desired")) Select Case nCase Case "L" For Each r In Selection.Cells If r.HasFormula Then r.Formula = LCase(r.Formul...

Re: Using Text Styles
Front page will not have a Next Edition. AFAIK it is dead. > Ed Bennett wrote: > > Ron Hagley wrote: > >> I have a document with Headings on one line followed by a linespace > >> then on a new line a subheading followed by (on the same line ) a > >> description > >> > >> I wish to use TEXT STYLES as this pattern repeats many times, I have > >> no problem seting up the styles for the headings, but when I do the > >> same for the SUBHEADINGS the text style is applied to the WHOLE line > >> including the description...

Text in Cell as Formula #2
Peo + Julie Many thanks for your answer with the last query. I Have a similar question, please advise: This method [INDIRECT()] does work with values form a different spreadsheet. I type the link (as text) from a different spreadsheet in a cell in the current spreadsheet and use this method to call a value in a cell. Would appreciate a detailed answer (if complicated) - I'm a novice user! Many thanks in advance. ...

MS Access excel-OLE Container Control Resize
In MS ACCESS 2003, is there anyway to programmatically resize the in-Process excel OLE container control after activation. Regards Sivanand FITSI, India. ...

Logical Test: Text Against Number 01-05-10
Can anyone provide insight into how Excel treats this type of test? For example, why does Excel return TRUE when we have ="a">2 but FALSE when ="a"<2 (or any other number for that matter). Thanks. That's the way it is treated. Any kind of text is larger than the largest number. Any worth? hit the YES below -- Max Singapore --- "rslaughter5" wrote: > Can anyone provide insight into how Excel treats this type of test? For > example, why does Excel return TRUE when we have ="a">2 but FALSE when ="a"<2 ...

Plain text warning/ VS2005
Whenever I add a CRecordset derived class, I get an error telling me the password for the DB is sent in "plain text" and is not secure etc. I comment that line out, but how much of a security risk is this? What can I do with my Access database to avoid this? VC 6.0 never gave this error... tia b If you are on any kind of network that anyone can look at, you are wide open for attack. Example, a University network; potentially, ever student can be running a packet sniffer and see your password. Anything that passes acros the Internet outside your local intranet is also vuln...

No password protect workbook box in Tools>Options>General
As is the case with much of this limited CD that was installed, some important features are missing. I want to password protect any given workbook. When I went to help (since the Tools>Protection didn't work) it told me to go to Tools>Options>General, and click on the box that said to password protect the workbook. As usual, this version has nothing of the sort on the General tab under Options. Now what? Why don't you get a full version if you expect full version capability? I'm at a loss... ******************* ~Anne Troy www.OfficeArticles.com "MS" <...

how can i use the same account with the same personal folders in two computers #2
please help in my company we have to use one account in two machines and we want every one in two machines to be aware of what the other do and what mails he send and recive, please note that dont use microsoft exchange as a mail server thanks in advance ...

Rotate text?
Office(publisher) 2K. Is there anyway to rotate a specific word in a sentence? L. Not if it's part of the sentence rather than being a separate text box. -- JoAnn Paules MVP Microsoft [Publisher] "L." <ofallon12320@yahoo1.com> wrote in message news:%23TBzesS9FHA.2616@TK2MSFTNGP15.phx.gbl... > Office(publisher) 2K. > > Is there anyway to rotate a specific word in a sentence? > > L. > > Thanks for the info. L. "JoAnn Paules [MSFT MVP]" <jl_paules@hotmail.com> wrote in message news:U46dnd7PfZ5CTBHenZ2dnUVZ_sidnZ2d@suscom....

Increment Number Without Using Autonumber
Hi Folks - I have a db that tracks felony charges against defendants. I have a main defendant form with a charges subform. On the subform, I have 2 fields: Count and Statute. Count is a number from 1 to 999. Statute is a drop-down that references the master statute table. Currently, the user will enter the count manually. However, I would like to automate this process if possible. One problem with the manual approach is if Count 3 of 10 Counts is deleted. This forces the user to re-number the Counts. Not sure how to handle this. Any ideas? Note: For each charge, there can be multiple v...

Combo Box Prolem
Hi All, I have a combo box that will not let me select the items using my mouse. I can use the Arrow Down Key and then hit TAB to select the item. The only thing that I think may be causing this is the ROW source. I have this change depending on the company location. See Code that fires when the user select the Customer ID. The 3rd line from the bottom sets the ROW source for the item. The combo box is bound to a feild called ITEM. Maybe this should be unbound. Can anyone help? Thanks Private Sub CustID_AfterUpdate() Dim stFilter As String Dim stEmp As String Dim stCoNum A...

Extracting pixel values from a picture control (continued)
Does anyone see what the problem is with this code, and if my process makes any sense? // Local vars int nImageSizeX = 640; int nImageSizeY = 480; char cFilename[256] = {"C:/Test1.bmp"}; // Load the image HBITMAP hBitmap = NULL; hBitmap = (HBITMAP) LoadImage(NULL, cFilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE); if (NULL == hBitmap) { exit(1); } // Set the bitmap to the picture control // m_picSource1 is a CStatic variable of the picture control on my dialog m_picDestination.SetBitmap(hBitmap); HDC hdc = (HD...