?
Solved

Richedit problem

Posted on 1998-10-02
12
Medium Priority
?
581 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
Industry Leaders: 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 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

765 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