drag out of a read-only box removes text
.NET, PowerShell, SQL, Java, Perl, and Javascript developer libraries
Brought to you by:
msorens
If you select text and drag it out of the ChameleonRickTextBox and drop it on another control, the text is removed from the original box, even if the source box has been set to ReadOnly. If the control is read-only, it shouldn't be editable in this way. Drag and drop is useful, but it shouldn't change the read-only source.
Very interesting find, Mark! I have so far traced this back to native RichTextBox behavior (rather than some artifact introduced by the multiple layers of inheritance building up to a ChameleonRichTextBox).
Also, it does not manifest in all cases! The defect surfaces when dragging from one (readonly) RichTextBox to a second RichTextBox within the same application. It does not surface when dragging from the readonly RichTextBox to Microsoft Outlook.
I will continue digging into this...
Mark:
According to information from Microsoft, read-only makes a control immutable only from manual editing; the control contents may still be modified by code or by drag-and-drop ! (Yes, surprised me, too!) It is possible to change this behavior but it requires quite a bit of code (see Control.DoDragDrop). Standard dragging behavior, according to Microsoft, does a move not a copy. The workaround, such as it is, also lies with standard drag-and-drop behavior: hold the Control key while dragging to do a copy instead of a move.
Changing this to a more visible status even though it is a .NET framework issue that is "by design" !