Solved

Richedit problem

Posted on 1998-10-02
12
577 Views
Last Modified: 2013-11-22
Is there a way to set limits/margins in a richedit control so that when the controld is resized, the text keeps within these limits/margins.
0
Comment
Question by:davidgreen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
12 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1341497
Does not WordWrap property of rich edit solves the problem?
0
 
LVL 10

Expert Comment

by:Jacco
ID: 1341498
Call repaint on resize?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1341499
Margens aren't supported in the standerd RichEdit component, because they aren't supported in the underlying RichEdit window-component.

Can't you make use of a panel?

Zif.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1341500
procedure SetMargin(VeryRich : TRichEdit; Indent : Integer);
Var
  R : TRect;
begin
  R := VeryRich.ClientRect;
  R.Left:=R.Left + Indent;
  R.Top:=R.Top + 2;
  R.Bottom:=R.Bottom - 2;
  R.Right:=R.Right - Indent;
  SendMessage(VeryRich.Handle, EM_SETRECT, 0, Longint(@R));
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  SetMargin(RichEdit1, 10);
end;

Regards,
Viktor Ivanov
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1341501
hey viktor, that looks nice!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1341502
:->
0
 

Author Comment

by:davidgreen
ID: 1341503
Sorry this took so long.. my email has been screwed up.. Thanks!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1341504
No problem :-)

Cheers,
Viktor
0
 

Author Comment

by:davidgreen
ID: 1341505
I gave the points before checking the code like a dummy!!!!  I cannot get this to work!!!!!!

Well... win some..lose some..

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1341506
Please tell me what is wrong so I can fix it for you. Don't worry we'll get this thing to work on your machine too. It works here.

Regards,
Viktor Ivanov
0
 

Author Comment

by:davidgreen
ID: 1341507
Lets say we have some text with the right margin set at a certain position. I want to be able to resize the form but have the text stopin the position it has been set at... so if I set the right margin at say 400 pixels.. I still wan 400 pixels if I increase the form size..
Is that clearer?
Thanks Viktor for your help.

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1341508
I'm not sure what you are talking about., Do you mind to create a project source code and send it to me and put some comments where what you are trying to do...?? PLease clarify some things...

btw- My e-mail address is viktor@megsinet.net

Cheers,
Viktor
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 97
Firemonkey webbrowser scrollbars ? 1 69
Delphi Seattle StructureView color 1 33
Typecasting TBytes to Integer in Delphi XE8 2 63
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question