我对数据的图形化表示完全陌生。我想根据学生每年的成绩做一份进度报告。例如,2005年的分数是750分。2006年780 2007年800
我想用图形化的方式展示它。有人能给我代码示例吗?
非常感谢。
发布于 2012-01-04 12:11:38
使用标签并设置Label.Width = intValue,其中intValue是您想要显示的值(您可以将其除以一个因子,以确保它保持在某个范围内)。你可以使用不同值范围的标签颜色或背景。例如。
假设valuelist是值的列表
Dim graphicallabels(n) As Label
For i As Integer = 0 To valuelist.length
graphicallabels(i) = New Label
With graphicallabels(i)
.Location = New Point(0, i * 2 * graphicallabels(i).Height)
.Width = valuelist(i)
End With
If valuelist(i)> 50 Then
graphicallabels(i).BackColor = Color.Green
Else
graphicallabels(i).BackColor = Color.Red
End If
Next注意:未测试的代码
HTH
https://stackoverflow.com/questions/8715205
复制相似问题