Solved

TRichEdit question

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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 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