【发布时间】:2020-07-29 07:58:57
【问题描述】:
我可以在 DevExpress 的标签控件中选择文本吗?
我需要这样的东西:
编辑
private void AddLayoutItem(LayoutControlGroup group, string name, string description)
{
group.AllowHtmlStringInCaption = true;
LabelControl label = new LabelControl
{
Name = Guid.NewGuid().ToString(),
Text = description,
Font = new Font("Tahoma", 11),
Padding = new Padding(25, 0, 0, 0),
AutoSizeMode = LabelAutoSizeMode.Vertical,
AllowDrop = true,
BorderStyle = 0,
IsAccessible = true
};
AddLayoutItem(group, name, label);
}
【问题讨论】:
-
您使用哪个组件来显示文本?
-
@MarkoJuvančič 是布局控件,添加截图
-
我的意思是显示文本的组件。例如,哪个类型的组件显示“IT Direktor”?
-
@MarkoJuvančič 它是 LabelControl。我尝试添加 AllowDrop、BorderStyle 和 IsAccessible,但它不起作用。添加代码
-
这就是您无法选择文本的原因。使用
TextEdit并将其BorderStyle属性设置为NoBorder并将ReadOnly设置为true。
标签: c# winforms devexpress