winform 实现lable文本复制效果

winform的lable文本没办法复制,可以使用其他控件模拟它的外观+设置不可编辑以模拟lable文本

1. 使用TextBox控件

 (1)设置属性让它的外观和lable一样

TextBox1.BackColor = System.Drawing.SystemColors.Control
TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None

 (2)重点

设置该控件的ReadOnly=true,设置TextBox1不可编辑 

 

posted @ 2021-09-30 15:49  哈哈咖咖  阅读(1115)  评论(0编辑  收藏  举报