Solved

TRichEdit question

Posted on 2000-02-24
8
246 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
  • 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
 

Author Comment

by:Masonok
ID: 2554124
Adjusted points to 60
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now