本文介绍了WinForms .NET 2.0+的标签云控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将如何在.NET 2.0+ WinForm应用程序中呈现标签云?

How would you render a tag cloud within a .NET 2.0+ WinForm application?

我正在考虑的一种解决方案是使用WebBrowser控件并生成特定的HTML,但这似乎是一个沉重的解决方案.

One solution that I am thinking of would be using the WebBrowser control and generating to some ad-hoc HTML, but that seems to be a pretty heavy solution.

我想念一些更简单的东西吗?

Am I missing something more simple?

推荐答案

如何创建实现Flow布局控件的用户控件?您可能有一个"Add(string tagName)"方法,该方法将动态创建一个链接标签并将其添加到Flow Layout控件中. Flow Layout的工作原理与Web相同,因为添加到其中的控件按创建顺序放置.

How about creating a user control that implements the Flow layout control? You could have a method for "Add(string tagName)" that would create a link label on the fly and add it to the Flow Layout control. The Flow Layout works just like the web, in that controls added to it are put in the order of creation.

然后,您只需要添加一些逻辑即可根据该标签的点击次数来调整链接标签"的大小.

Then you only have to add some logic to resize the Link Label based on hit count for that tag.

这篇关于WinForms .NET 2.0+的标签云控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 12:57