Yisroel M. Olewski
Yisroel M. Olewski

Reputation: 1626

Cannot cut text from textbox

When selecting "cut" from the TexBoxes' context menu, it works as if I did a "copy".

Same goes if I do a control-x, it simply copies instead of cutting.

Here is my simple dimple xaml

<Window x:Class="Window2" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window2">
    <TextBox/>
</Window>

Anybody have any idea what might be wrong?

ENVIRONMENT:

Upvotes: 3

Views: 1129

Answers (3)

sdx
sdx

Reputation: 11

I had the some issue using VS2015 on Windows 10 pro 64 bit as a Virtualbox 5.1.6 guest on a OSX host. The "problem" was the Virtualbox Shared clipboard between the guest and a host OS (Guest To Host).

Upvotes: 1

Jeffrey Harmon
Jeffrey Harmon

Reputation: 2437

I just had this issue, and found the issue was due to Notepadd++'s Clipboard History feature. Once I closed the program, cutting worked perfectly.

It is definitely caused by external programs doing clipboard interference (probably incorrectly), as it was Notepad++ for me, and VNC for @Yisman. It should be considered a WPF bug though, since any non-WPF application can cut perfectly with Notepad++'s Clipboard History running.

My best guess, after looking at the details from the Connect post, is that the copy part of the cut command throws an exception, but throws is after adding the text to the clipboard. Other programs will still do the delete portion of the cut command, where WPF will skip it. This is reasonable, as it probably assumes it wasn't added to the clipboard, since the copy failed, but doesn't work well in this case.

Upvotes: 2

Yisroel M. Olewski
Yisroel M. Olewski

Reputation: 1626

in my situation, the culprit in the end was vnc viewer

you may find the following interesting or helpful

https://connect.microsoft.com/VisualStudio/feedback/details/798501/textbox-cut-bug-in-wpf

hope this helps you!

Upvotes: 1

Related Questions