Resizing Form - RVE

General TRichView support forum. Please post your questions here
Post Reply
LonelyRanger
Posts: 11
Joined: Sun Jul 23, 2006 6:11 am

Resizing Form - RVE

Post by LonelyRanger »

Hi there,

I cannot remember for the likes of me what I did last time to stop the following issue...

Click a button and it puts whatever is in the editbox into the RVE. As below is the result.

Code: Select all

This is a test
This is a test 2
This is a test 3
Now if I resize the form it ends up like the following...

Code: Select all

This is a testThis is a test 2This is a test 3
I have fixed this before but I cannot remember!

Cheers.
Sergey Tkachenko
Site Admin
Posts: 17499
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

How did you add this text?
LonelyRanger
Posts: 11
Joined: Sun Jul 23, 2006 6:11 am

Post by LonelyRanger »

Hi Sergey,

Add("this is a test", 0);
Add("this is a test 2", TextStyleInc);
FormatTail;

It is fine if the entire line can be the same text style as i simply use AddNL(). However, as shown above I use 2 different styles on the same line.

Cheers.
Sergey Tkachenko
Site Admin
Posts: 17499
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If I understand the problem correctly, it is because FormatTail.
This method works correctly only if, since the last call of Format/FormatTail, new content was added from new line.
Use Format instead of FormatTail.
LonelyRanger
Posts: 11
Joined: Sun Jul 23, 2006 6:11 am

Post by LonelyRanger »

I didnt have this problem in another project about 3 weeks ago and was using formattail. I looked over and over the old code and couldnt find what I had done. So it must have been a property that allowed me to set an option to maintain current layout or something. Wish I knew what i did.

Cheers,
LR.
LonelyRanger
Posts: 11
Joined: Sun Jul 23, 2006 6:11 am

Post by LonelyRanger »

Ok, sorry Sergey but I finally worked out what it was that I had been doing...

I would start the line with AddNL() first and then append using Add() and called FormatTail when I was all done. This prevents the issue that I outlined in the original post.

Thx for your time.
LR.
Sergey Tkachenko
Site Admin
Posts: 17499
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, the first item after the last call of Format/FormatTail must be added from new line. Otherwise, FormatTail works incorrectly.
Post Reply