Solved

Richedit problem

Posted on 1998-10-02
12
572 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
  • 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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