Solved

TRichEdit question

Posted on 2000-02-24
8
251 Views
Last Modified: 2010-04-04
I drag&drop this text from Outlook mail window and after that I cannot delete or edit this text (but I can insert&edit text after & before this "special" fragment). If I drag this text in MS-Word and from MS-Word drag into my program I can operate with this text normally! How can I solve this problem?

0
Comment
Question by:Masonok
[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
8 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 2554064
Try to exclude caProtected from the newly inserted text (TextAttributes). It looks as if it would be protected text. Alternatively, you can assign an OnProtectChange event handler.

Ciao, Mike
0
 

Author Comment

by:Masonok
ID: 2554103
RichEdit1.selAttributes.Protected:=False;
doesn't work - where is the mistake?
0
 

Author Comment

by:Masonok
ID: 2554108
I tried to make text protected (True) and it became absolutely as "special" text. But when I tried to put Protection to False position "special" text remaines protected!
0
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!

 

Author Comment

by:Masonok
ID: 2554124
Adjusted points to 60
0
 

Author Comment

by:Masonok
ID: 2554125
You ARE THE MAN!! If I make "AllowChange:=True"  it works!!!
That is GREAT!

Please tell me: Is there a possibility to remove protection from the text? and 60 points (instead of 50) will be yours!
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2554156
Setting the protection property to False should work (caProtected was of course wrong as this flag is used in the consistent text attributes, but you still got it :-)). Are you sure you are modifying the correct selection?

Ciao, Mike
0
 

Author Comment

by:Masonok
ID: 2554171
Absolutely! I just type "fffffffffffff" on the new line, select this text and set Protected to "True" then select this text and tried to set to "false" and then tried to change it - nothing happend!

0
 
LVL 10

Accepted Solution

by:
Lischke earned 60 total points
ID: 2554219
Yeah, I found the problem. It's the fact that the rich edit calls back about the protection change. This happens exactly as when you try to change protected text. This means you still need OnProtectChange. The strange thing is that you cannot set a text to protected again if you always return AllowChange = True. It is in fact so that (if you have the event handler attached) text can be set to be protected if you return False (in AllowChange) or can be edited if you return True (but not set to protected state).

Ciao, Mike
0

Featured Post

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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 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