C# 带有超链接的PropertyGrid提示?
是否可以在属性网格提示中添加可单击的超链接 我的类中有以下内容(作为C# 带有超链接的PropertyGrid提示?,c#,winforms,propertygrid,C#,Winforms,Propertygrid,是否可以在属性网格提示中添加可单击的超链接 我的类中有以下内容(作为SelectedObject指定给属性网格): 在属性网格中查看时,链接不可单击。有什么想法吗?查看MSDN参考资料,PropertyGrid使用了两个标签,一个用于标题,一个用于说明: 标签不支持超链接。您可以在描述标签上放置一个RichTextBox,让它显示文本。例如 PropertyGrid pg = new PropertyGrid() { Dock = DockStyle.Fill }; Contr
SelectedObject
指定给属性网格):
在属性网格中查看时,链接不可单击。有什么想法吗?查看MSDN参考资料,
PropertyGrid
使用了两个标签,一个用于标题,一个用于说明:
标签
不支持超链接。您可以在描述标签上放置一个RichTextBox
,让它显示文本。例如
PropertyGrid pg = new PropertyGrid() { Dock = DockStyle.Fill };
Control c = pg.Controls[0]; // internal DocComment control
Label l1 = (Label) c.Controls[1];
RichTextBox tb = new RichTextBox { Multiline = true, WordWrap = true, ReadOnly = true, BorderStyle = BorderStyle.None };
c.Controls.Add(tb);
c.Controls.SetChildIndex(tb, 0);
l1.TextChanged += delegate {
tb.Text = l1.Text;
};
l1.SizeChanged += delegate {
tb.Size = l1.Size;
};
l1.LocationChanged += delegate {
tb.Location = l1.Location;
};
真是个好主意:)我稍后会试一试。谢谢+1
PropertyGrid pg = new PropertyGrid() { Dock = DockStyle.Fill };
Control c = pg.Controls[0]; // internal DocComment control
Label l1 = (Label) c.Controls[1];
RichTextBox tb = new RichTextBox { Multiline = true, WordWrap = true, ReadOnly = true, BorderStyle = BorderStyle.None };
c.Controls.Add(tb);
c.Controls.SetChildIndex(tb, 0);
l1.TextChanged += delegate {
tb.Text = l1.Text;
};
l1.SizeChanged += delegate {
tb.Size = l1.Size;
};
l1.LocationChanged += delegate {
tb.Location = l1.Location;
};