简体   繁体   中英

copy to clipboard from disabled Textbox

I have a TextBox disabled but would like the user to still be able to copy its content to the clipboard. However when IsEnabled is not set copy/paste is not allowed.

Is there a way to achieve this?

You're not really supposed to interact with a "disabled" control.

Instead, set the TextBox.IsReadOnly property to true.

If you want it to "look" disabled, you could set the background color to grey, like it is when it is disabled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM