Menu

#87 drag out of a read-only box removes text

open
nobody
5
2012-09-17
2009-08-06
Mark Morgan
No

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.

Discussion

  • Michael Sorens

    Michael Sorens - 2009-08-06

    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...

     
  • Michael Sorens

    Michael Sorens - 2009-08-13

    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.

     
  • Michael Sorens

    Michael Sorens - 2010-02-24

    Changing this to a more visible status even though it is a .NET framework issue that is "by design" !

     

Log in to post a comment.

MongoDB Logo MongoDB